Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a7p

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a7p

Simple python3 wrapper for .a7p files

  • 0.0.11.post1
  • Source
  • PyPI
  • Socket score

Maintainers
1

Table of Contents

  • Description
  • Instalation
  • Usage
  • Gallery

Description

Simple python3 wrapper for .a7p files \

Instalation

with pypx
pipx install a7p
As common from PyPi:
pip install a7p
or latest from repository:
git clone https://github.com/o-murphy/a7p
cd a7p_transfer_example/a7p_py
python setup.py install

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

Usage

CLI-tool
a7p -h
usage: a7p 0.0.10 [-h] [-V] [-r] [-v] [--verbose] path

positional arguments:
  path             Path to the directory or file

options:
  -h, --help       show this help message and exit
  -V, --version    show program's version number and exit
  -r, --recursive  Recursively walk files
  -v, --validate   Validate files
  --verbose        Verbose

Direct
import logging
from a7p import A7PFile, A7PDataError
from a7p.factory import A7PFactory

# 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)

    
# creating a new a7p Payload
payload = A7PFactory(
    meta=A7PFactory.Meta(
        name="test profile name",
    ),
    bullet=A7PFactory.Bullet(
        weight=175,
        length=0.9
    ),
    distances=A7PFactory.DistanceTable.LONG_RANGE
)
with open('data/test.a7p', 'wb') as fp:
    A7PFile.dump(payload, fp)

Latest updates available at JsDelivr CDN

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc