Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Simple python3 wrapper for .a7p files

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

.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-yupy] 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-yupy        Disable yupy 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.

key unit multiplier desc
sc_height mm 1 sight height in mm
r_twist inch 100 positive twist value
c_zero_temperature C 1 temperature at c_muzzle_velocity
c_muzzle_velocity mps 10 muzzle velocity at c_zero_temperature
c_t_coeff %/15C 1000 temperature sensitivity
c_zero_distance_idx 10 index of zero distance from distances table
c_zero_air_temperature C 1 air temperature at zero
c_zero_air_pressure hPa 10 air pressure at zero
c_zero_air_humidity % 1 air humidity at zero
c_zero_p_temperature C 1 powder temperature at zero
c_zero_w_pitch deg 1 zeroing look angle
b_diameter inch 1000 bullet diameter
b_weight grain 10 bullet weight
b_length inch 1000 bullet length
twist_dir RIGHT|LEFT twist direction
bc_type G1|G7|CUSTOM g-func type
distances m 100 distances table in m
zero_x -1000 zeroing h-clicks for specific device
zero_y 1000 zeroing v-clicks for specific device
coef_rows.bc_cd (G1/G7) 10000 bc coefficient for mv
coef_rows.mv (G1/G7) mps 10 mv for bc provided
coef_rows.bc_cd (CUSTOM) 10000 drag coefficient (Cd)
coef_rows.mv (CUSTOM) mach 10 speed in mach

Download files

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

Source Distribution

a7p-1.2.0a2.tar.gz (148.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a7p-1.2.0a2-py3-none-any.whl (65.0 kB view details)

Uploaded Python 3

File details

Details for the file a7p-1.2.0a2.tar.gz.

File metadata

  • Download URL: a7p-1.2.0a2.tar.gz
  • Upload date:
  • Size: 148.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for a7p-1.2.0a2.tar.gz
Algorithm Hash digest
SHA256 b8654ada1252ea69afe835786f13a72b72c01ce554f51f4f203f86e2a20a81f8
MD5 a4726f319b2069d2d3bcf24f861f877e
BLAKE2b-256 c4ac6afa62f2fe97bca9598ec4959adf46b8220c1a81a3d06be03ad01ba3f227

See more details on using hashes here.

File details

Details for the file a7p-1.2.0a2-py3-none-any.whl.

File metadata

  • Download URL: a7p-1.2.0a2-py3-none-any.whl
  • Upload date:
  • Size: 65.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for a7p-1.2.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4d7c162762a525d1d5e4cfa16f4f04a4352fcd1e4dc4cea603fe7b8330d406
MD5 ac2e8dfa7c17a90a9c65f426d4b0db01
BLAKE2b-256 73f7fca0eef385c1ad803d3f698020c39a588baf2cd31eb58b6bf179c35be432

See more details on using hashes here.

Supported by

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