circulation-import-0.0.1
توضیحات
Set of tools facilitating the process of importing book collections into SimplyE's Circulation Manager by using SFTP protocol
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | circulation-import-0.0.1 |
| نام | circulation-import |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Viacheslav Bessonov |
| ایمیل نویسنده | viacheslav.bessonov@hilbertteam.com |
| آدرس صفحه اصلی | https://github.com/vbessonov/circulation-import |
| آدرس اینترنتی | https://pypi.org/project/circulation-import/ |
| مجوز | MIT |
# circulation-import
Set of tools facilitating the process of importing book collections into SimplyE's Circulation Manager by using SFTP protocol.
## Architecture
circulation-import consists of two parts:
- **client** responsible for uploading content to the SFTP server, waiting for a report, downloading it and converting it to CSV format
- **server** responsible for watching for new book collections, importing them into CM using its **directory_import** script and uploading a report to the SFTP server
Picture below illustrates the architecture of the solution:

Another picture below contains a sequence diagram

## Usage
1. Update all the submodules:
```bash
git submodule update --remote --recursive
cd circulation-lcp-test
git submodule update --remote --recursive
cd ..
```
2. Run the LCP testbed:
```bash
docker-compose --file circulation-lcp-test/docker-compose.yml --env-file circulation-lcp-test/.env up -d
```
3. Follow the instructions in LCP testbed's [README.md file](circulation-lcp-test/README.md) to set it up
4. Run the server:
```bash
docker-compose --file circulation-lcp-test/docker-compose.yml --file docker-compose.yml --env-file circulation-lcp-test/.env up -d
```
5. Create and activate a virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate
```
3. Install *circulation-import* from PyPi:
```bash
pip install circulation-import
```
7. Run the client:
```bash
python -m circulation-import client import \
--collection-name=lcp \
--data-source-name=data_source_1 \
--books-directory=./circulation-lcp-test/lcp-collection/collection \
--covers-directory=./circulation-lcp-test/lcp-collection/collection \
--reports-directory=./reports \
--metadata-file=./circulation-lcp-test/lcp-collection/collection/onix.xml \
--metadata-format=onix \
--configuration-file=./configuration/client-configuration.yml \
--logging-configuration-file=./configuration/logging.yml
```
8. Go to [reports](./reports) folder and find a report in CSV format
نیازمندی
| مقدار | نام |
|---|---|
| >=0.10.3,<0.11.0 | watchdog |
| >=1.3.19,<2.0.0 | sqlalchemy |
| >=0.0.2,<0.0.3 | sqlalchemy-repr |
| >=0.6.0,<0.7.0 | typing-inspect |
| >=0.16.10,<0.17.0 | ruamel.yaml |
| >=20.1.0,<21.0.0 | attrs |
| >=7.1.2,<8.0.0 | click |
| >=2.7.2,<3.0.0 | paramiko |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl circulation-import-0.0.1:
pip install circulation-import-0.0.1.whl
نصب پکیج tar.gz circulation-import-0.0.1:
pip install circulation-import-0.0.1.tar.gz