Comments (4)
Hey ! can I take up the issue?
from podaacpy.
Hi @swatisingh45 yes please. The idea would be to add a new parameter to both def granule_subset(self, input_file_path, path='') and extract_l4_granule(self, dataset_id='', path='') to essentially include a boolean flag to persistence in s3.
The new function signatures would then look something like
extract_l4_granule(self, dataset_id='', store='local', path='')
...
granule_subset(self, input_file_path, store='local', path='')
By default the storage device would be 'local' disk however the possible options would be both 'local' and 's3'.
When using s3 we should introduce a config.properties
file which essentially contains key values representing the AWS configuration e.g. username and password. This file could be read when the user create an instance of Podaac()
.
Regarding the code for uploading files to s3, you can base it on the following example
import boto
import boto.s3
import sys
from boto.s3.key import Key
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
bucket_name = AWS_ACCESS_KEY_ID.lower() + '-dump'
conn = boto.connect_s3(AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY)
bucket = conn.create_bucket(bucket_name,
location=boto.s3.connection.Location.DEFAULT)
testfile = "replace this with an actual filename"
print 'Uploading %s to Amazon S3 bucket %s' % \
(testfile, bucket_name)
def percent_cb(complete, total):
sys.stdout.write('.')
sys.stdout.flush()
k = Key(bucket)
k.key = 'my test file'
k.set_contents_from_filename(testfile,
cb=percent_cb, num_cb=10)
Thank you for taking this issue on, if you have any issues then please let me know.
from podaacpy.
@swatisingh45 are you working on this? If not then I will do it, thank you.
from podaacpy.
Using Apache LibCloud's Python Object Storage API might be a good idea here.
from podaacpy.
Related Issues (20)
- Add API's for PO.DAAC Drive HOT 1
- Update release management policy to use twine HOT 6
- Python 2.6 master build failing HOT 2
- Implement Level3 and Level4 subsetting logic HOT 14
- Maintain directory structure when downloading from PODAAC Drive
- Augment Drive.download_granules with 'root' parameter HOT 1
- Function "mine_drive_urls_from_granule_search()" Returns Empty List HOT 3
- Refactor for the deprecation of FTP? HOT 10
- Question about granule_search() from web services API HOT 4
- Replace xml.etree.ElementTree.fromstring functions with their defusedxml equivalents. HOT 3
- Implement integration tests for drive.py HOT 2
- Accessing CYGNSS L0 data with podaacpy HOT 9
- Add support for Remote Sensing Systems (RSS) HTTP data access HOT 1
- Add PodaacUtils.mine_drive_urls_from_granule_search function
- drive.Drive(file) attempts to read from erroneous 'tests' directory
- Change root branch from master to main HOT 1
- PodaacUtils().list_all_available_extract_granule_dataset_ids() returns None HOT 1
- Port to Rust and Expose Crate and FFI Python Module HOT 3
- Working with proxy HOT 2
- Error in the example file "Using Podaacpy to retrieve CYGNSS Level 3 Science Data.ipynb" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podaacpy.