Skip to main content
# lib-python-astr

[![PyPI version](https://badge.fury.io/py/libastr.svg)](https://badge.fury.io/py/libastr)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.

### Purpose

Libastr is a **Python3** library designed to ease python scripting with
the API of A.S.T.R. (Archiving System Truly RESTful).
It includes multiple features like browsing, downloading and uploading archives.

### Installation

1. Git clone the repository.

2. Install the library with pip. It is advised to use
[virtualenv](http://virtualenvwrapper.readthedocs.io/en/latest/):
```
pip install lib-python-astr
```

### Configuration

To communicate with the ASTR server, three parameters must be given to the
an instance of the class `AstrClient`:
* base_url: ASTR instance base url (e.g. http://my-astr-server:8000)
* email: a user email
* token: a token of this user (to be generated on the website)

```python
from libastr import AstrClient
client = AstrClient(base_url, email, token)
```

Or, to avoid giving all these parameters manually, they can be stored in
environment variables:

```
export LIBASTR_URL='http://my-astr-server:8000'
export LIBASTR_EMAIL='john.doe@my-email.com'
export LIBASTR_TOKEN='b4b71bf6-a3dd-4975-85b8-03de05096fc0'
```

Then, if you make an instance of `AstrClient` without giving arguments, it
will fetch these environment variables by default.

### Basic usage

```python
from libastr import Browser

# If you use environment variables to connect to the server...
browser = Browser()
# Or if yo use custom variables...
from libastr import AstrClient
client = AstrClient(base_url, email, token)
browser = Browser(client)

# Retrieve some archives
my_archives = browser.get_archives_by_args(
author="John DOE",
category="MY CATEGORY",
descriptors={"my_desc": "MY VALUE"})

# download an archive
my_archives[0].download(local_path="/home/john.doe/Documents/")

# Retrieve all categories
cat = browser.get_all_archive_categories()

# Get descriptors of one category
cat[0].get_descriptors()
```


Metadata

Release files for libastr 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libastr 1.1.0
File Size Uploaded Provenance Actions
libastr-1.1.0.tar.gz 8.5 kB Without provenance Details for libastr-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for libastr 1.1.0
File Interpreter ABI Platform Actions
libastr-1.1.0-py3-none-any.whl Python 3 none any Details for libastr-1.1.0-py3-none-any.whl

Total release size: 19.1 kB

Release files / libastr-1.1.0.tar.gz

Download URL libastr-1.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
458331c0ba7f50cb4bcf52a1f12553d3c6f085ad35cfed43b070605b8b51a328
BLAKE2b-256 checksum
How to use checksums
7e6b374fef3dbf453dcd69fcc068f35ef5e6365027eb22b3c27d25568fa17148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.2

Release files / libastr-1.1.0-py3-none-any.whl

Download URL libastr-1.1.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adcb80d352f0d765acb74941f6f9e7879ffefaede2b4e7fc087b2239b07b156f
BLAKE2b-256 checksum
How to use checksums
57b0b578bae3b0c8c6c8bf4f355d36ef100e90f5abfbb98e976cb34cd174d914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.2

Security for libastr 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page