datacycle-0.0.3
توضیحات
General toolset to backup & restore with random/filtered/anonymized data (Mongo/Postgres/GCS).
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | datacycle-0.0.3 |
| نام | datacycle |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/smood/recycle |
| آدرس اینترنتی | https://pypi.org/project/datacycle/ |
| مجوز | MIT |
# Datacycle
## Getting started
```
cp .env.example .env
vim .env
source .env
poetry install --extras all
poetry run datacycle
```
```
docker build -f Dockerfile -t datacycle .
docker run -it --rm --env-file .env datacycle
```
### Mac requirements
```
brew install mongodb/brew/mongodb-database-tools
brew install libpq
brew link --force libpq
npm install elasticdump -g
```
### Linux requirements
```
apt install -y mongo-tools
apt install -y postgresql-client
npm install elasticdump -g
```
## How to
```
datacycle --help
datacycle doctor
datacycle mongo "mongodb://user:password@localhost:27017/test1?authSource=admin" "mongodb://user:password@localhost:27017/test2?authSource=admin" --transform "
transforms {
test1 {
before-transform {}
}
}
"
datacycle mongo mongodb://user:password@localhost:27017/test1?authSource=admin gs://datacycle-test/test1/snapshot --transform ops.hocon
datacycle mongo mongodb://user:password@localhost:27017/test1?authSource=admin mongodb://user:password@localhost:27017/test2?authSource=admin
datacycle mongo mongodb://user:password@localhost:27017/test1?authSource=admin gs://datacycle-test/test1/snapshot
datacycle mongo mongodb://user:password@localhost:27017/test1?authSource=admin test1/snapshot
datacycle mongo gs://datacycle-test/test1/snapshot mongodb://user:password@localhost:27017/test2?authSource=admin
datacycle mongo gs://datacycle-test/test1/snapshot gs://datacycle-test/test2/snapshot
datacycle mongo gs://datacycle-test/test1/snapshot test2/snapshot
datacycle mongo test1/snapshot mongodb://user:password@localhost:27017/test2?authSource=admin
datacycle mongo test1/snapshot gs://datacycle-test/test2/snapshot
datacycle mongo test1/snapshot test2/snapshot
```
## Providers
### Postgres
https://www.postgresql.org/docs/9.1/backup.html
- SQL dump
- file system snapshot
- continuous archiving
```
pg_dump --clean "postgres://user:password@localhost:5432/test" | gzip > dump.gz
gunzip -c dump.gz | psql "postgres://user:password@localhost:5432/test"
```
### Mongo
https://docs.mongodb.com/manual/core/backups/
- BSON dump
- file system snapshot
- CDC
```
mongodump --uri="mongodb://user:password@localhost:27017/test?authSource=admin" --out=dump --numParallelCollections=10 -v --gzip
mongorestore --uri="mongodb://user:password@localhost:27017/test?authSource=admin" dump/test --numParallelCollections=10 -v --gzip
```
### Elasticsearch
https://github.com/elasticsearch-dump/elasticsearch-dump
- dump
```
elasticdump --input=https://localhost:9200 --output=$ --limit 2000 | gzip > dump.gz
```
نیازمندی
| مقدار | نام |
|---|---|
| >=13.3.4,<14.0.0 | Faker |
| >=4.1.0,<5.0.0) | pymongo |
| >=1.4.13,<2.0.0) | SQLAlchemy |
| >=1.19.4,<2.0.0) | pg8000 |
| >=0.0.1,<0.0.2 | tdqm |
| >=0.4.1,<0.5.0 | typer |
| >=2.1.2,<3.0.0 | furl |
| >=1.4.0,<2.0.0 | dataconf |
| >=0.4.1,<0.5.0 | sqlparse |
| >=5.9,<6.0) | gsutil |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8,<3.11 | Python |
نحوه نصب
نصب پکیج whl datacycle-0.0.3:
pip install datacycle-0.0.3.whl
نصب پکیج tar.gz datacycle-0.0.3:
pip install datacycle-0.0.3.tar.gz