Skip to main content

Simple python3 wrapper for .a7p files

Project description

Table of Contents

Description

Simple python3 wrapper for .a7p files

Instalation

As common from PyPi:

pip install a7p

or latest from repository:

git clone https://github.com/o-murphy/a7p_transfer_example
cd a7p_transfer_example/a7p_py
python setup.py install

This command builds the Docker image and tags it as go-server.

Usage

import logging
from a7p import A7PFile, A7PDataError

# open file in binary mode
with open('data/test.a7p', 'rb') as fp:

    # read data from file
    try:
        profile_opj = A7PFile.load(fp)
    except A7PDataError as exc:  # raises if md5 crc not match
        logging.error(exc)

# accessing attributes as for default protobuf payload
profile_name = profile_opj.profile.profile_name    

# data conversion to common types
as_json = A7PFile.to_json(profile_opj)
as_dict = A7PFile.to_dict(profile_opj)
from_json = A7PFile.from_json(profile_opj)
from_dict = A7PFile.from_dict(profile_opj)

# saving builded profile
with open('data/test.a7p', 'rb') as fp:
    A7PFile.dump(profile_opj, fp)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a7p-0.0.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

a7p-0.0.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file a7p-0.0.2.tar.gz.

File metadata

  • Download URL: a7p-0.0.2.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for a7p-0.0.2.tar.gz
Algorithm Hash digest
SHA256 248e815e53889f39252f830bbb4a78cb9c1ebab7722ad99d45f1f7accd1eaa1f
MD5 f94616462d6c46861219c01ee48800ed
BLAKE2b-256 0de2230a943961a9bd1a11b2d77127d76df5e2f1b049a114ea4d206615122a72

See more details on using hashes here.

File details

Details for the file a7p-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: a7p-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for a7p-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d1b4838bb97afdcd2ec130a1f1e4baec81528a5358d2931516b4dc445f60909b
MD5 096222cc1fab1ce15473329f7426f851
BLAKE2b-256 87e4e60a2aec42577f958b15e8db6858d9a0885ca94b26a415a7d19240d96ecb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page