Comments (1)
@SergioSim a draft implementation has been made in a Jupyter notebook. Parts of this draft implementation follows.
Requirements
python-keystoneclient
python-swiftclient
Configuration
Configure your OpenStack environment:
$ export OS_AUTH_URL="https://auth.cloud.ovh.net/"
$ export OS_TENANT_ID="xxx"
$ export OS_TENANT_NAME="xxx"
$ export OS_PASSWORD="xxx"
$ export OS_USERNAME="xxx"
$ export OS_LRS_CONTAINER_URL="xxx"```
Download archives
import logging
import os
from swiftclient.service import SwiftService, SwiftError
logging.basicConfig(level=logging.INFO)
logging.getLogger("requests").setLevel(logging.ERROR)
logging.getLogger("swiftclient").setLevel(logging.ERROR)
logger = logging.getLogger(__name__)
def download(container, objects, options=None):
with SwiftService(options=options) as swift:
try:
for download in swift.download(container=container, objects=objects):
if download['success']:
logger.info("Successfully downloaded: %s", download['object'])
else:
logger.error("Failed to download: %s", download['object'])
except SwiftError as e:
logger.error(e.value)
raise e
container = "lrs-xapi-statements"
archives = ["2020-04-29.gz", ]
options = {
"os_storage_url": os.environ["OS_LRS_CONTAINER_URL"].replace(f"/{container}", "")
}
download(container, archives, options)
Swift client documentation: https://docs.openstack.org/python-swiftclient/latest/service-api.html
from ralph.
Related Issues (20)
- Add Graylog backend
- (api) Make code tidier by replacing scopes as strings
- Replace Python linters with Ruff
- Support Python 3.12
- Remove JSON column from ClickHouse backend HOT 1
- Rewrite contributing section in documentation
- Switch from setup.cfg to pyproject.toml
- Add "# TODO" check to linting
- Ensure testing of `count` as result of `write`, for all backends. HOT 1
- Fix `www-authenticate` header HOT 1
- Modifying `settings` on a DataBackend does not update `client`
- [Clickhouse]Look into removing use of both `statementId` and `statement_id` in queries
- [pydantic >2] Replace deprecated `parse_obj_as`
- [Pydantic > 2] Replace for loop in `factory.py` model generation HOT 1
- [pydantic > 2] xAPI extensions cannot hold empty strings
- [pydantic > 2] [API] Fix `IRI` typing of `verb` and `activity` queries in `get`
- [pydantic > 2] [api] Add URL validation to `openid` field
- [backends] [clickhouse] Look into removing redundency of `statement_id` and `statementId`
- [pydantic > 2] [tests] [polyfactory] Remove custom value for `course_id`
- Rename LDP `DEFAULT_STREAM_ID` setting to `STREAM_ID` HOT 1
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 ralph.