Catalog PyPI
PACKAGE EXPLORERView in registry

a7p

PyPI

A7P ballistic profile format — encode/decode and validation

a7parcherprotobuf
Versions collected1
Direct dependencies7From release 1.2.5
Last observed20 Oct, 16:45 UTC

README

Version 1.2.5 documentation

Simple python3 wrapper for .a7p files

[PyPI Version(https://pypi.org/project/a7p)] license

.a7p is the most common ballistic profile format for the latest Archer thermal vision devices

Table of Contents

Installation

As CLI tool

# with `uv`
uv tool install a7p

# with `pipx`
pipx install a7p

Installation to your project:

# with `uv`
uv add a7p

# with `pip`
pip install a7p

[!TIP] You can install orjson - the fast Rust-based JSON encoding backend To install it together with a7p use optional dependencies group a7p[orjson]

Usage

CLI-tool

a7p -h
usage: a7p 1.0.0b3 [-h] [-V] [-r] [-F] [--unsafe] [--jsonify] [--verbose] [-zd ZERO_DISTANCE] [-d {subsonic,low,medium,long,ultra}] [-zs ZERO_SYNC | -zo X_OFFSET Y_OFFSET] [-cps COPY_SWITCHES] [--disable-validator] path

positional arguments:
  path                  Specify the path to the directory or a .a7p file to process.

options:
  -h, --help            show this help message and exit
  -V, --version         Display the current version of the tool.
  -r, --recursive       Recursively process files in the specified directory.
  -F, --force           Force saving changes without confirmation.
  --unsafe              Skip data validation (use with caution).

Single file specific options:
  --jsonify             Print as json. This option is only allowed for a single file.
  --verbose             Enable verbose output for detailed logs. This option is only allowed for a single file.

Distances:
  -zd ZERO_DISTANCE, --zero-distance ZERO_DISTANCE
                        Set the zero distance in meters.
  -d {subsonic,low,medium,long,ultra}, --distances {subsonic,low,medium,long,ultra}
                        Specify the distance range: 'subsonic', 'low', 'medium', 'long', or 'ultra'.

Zeroing:
  -zs ZERO_SYNC, --zero-sync ZERO_SYNC
                        Synchronize zero using a specified configuration file.
  -zo X_OFFSET Y_OFFSET, --zero-offset X_OFFSET Y_OFFSET
                        Set the offset for zeroing in clicks (X_OFFSET and Y_OFFSET).

Switches:
  -cps COPY_SWITCHES, --copy-switches-from COPY_SWITCHES
                        Copy switches from other a7p file.

Advanced:
  --disable-validator   Disable JSON Schema validation (unsafe).

Use as imported module

import logging
import a7p
from a7p import exceptions, A7PFactory

# open file in binary mode
with open('data/test.a7p', 'rb') as fp:
    # read data from file
    try:
        payload = a7p.load(fp)
    except exceptions.A7PDataError as exc:  # raises if md5 crc not match
        logging.error(exc)

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

# data conversion to common types
payload_json = a7p.to_json(payload)
payload_dict = a7p.to_dict(payload)
from_json = a7p.from_json(payload_json)
from_dict = a7p.from_dict(payload_dict)

# saving builded profile
with open('data/test.a7p', 'rb') as fp:
    a7p.dump(payload, 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:
    a7p.dump(payload, fp)

Dimensions

To obtain values from an .a7p profile in the desired units, you need to divide them by the multiplier. For the reverse operation, you need to perform the inverse operation and convert to an integer.

keyunitmultiplierdesc
sc_heightmm1sight height in mm
r_twistinch100positive twist value
c_zero_temperatureC1temperature at c_muzzle_velocity
c_muzzle_velocitymps10muzzle velocity at c_zero_temperature
c_t_coeff%/15C1000temperature sensitivity
c_zero_distance_idx10index of zero distance from distances table
c_zero_air_temperatureC1air temperature at zero
c_zero_air_pressurehPa10air pressure at zero
c_zero_air_humidity%1air humidity at zero
c_zero_p_temperatureC1powder temperature at zero
c_zero_w_pitchdeg1zeroing look angle
b_diameterinch1000bullet diameter
b_weightgrain10bullet weight
b_lengthinch1000bullet length
twist_dirRIGHT|LEFTtwist direction
bc_typeG1|G7|CUSTOMg-func type
distancesm100distances table in m
zero_x-1000zeroing h-clicks for specific device
zero_y1000zeroing v-clicks for specific device
coef_rows.bc_cd (G1/G7)10000bc coefficient for mv
coef_rows.mv (G1/G7)mps10mv for bc provided
coef_rows.bc_cd (CUSTOM)10000drag coefficient (Cd)
coef_rows.mv (CUSTOM)mach10speed in mach

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.2.515 Oct 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
o-murphy/a7p

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:45 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c92591b35e4d25dbf0c1a62f89b0b5faed75a8e1f132249b5102897a02cdd54a