Skip to main content
APSG logo

PyPI - Version Conda Documentation Status codecov DOI

APSG is the package for structural geologists. It defines several new Python classes to easily manage, analyze and visualize orientation structural geology data.

Check CHANGELOG.md for recent updates.

Quick example

from apsg import *

f = folset.random_fisher(position=fol(130, 60))
s = StereoNet()
s.great_circle(f)
s.point(f)
s.contour(f)
s.show()

StereoNet supports both equal-area (Schmidt, default) and equal-angle (Wulff) projections, lower and upper hemisphere, and rotating the whole net independently of the plotted data. See the stereonet tutorial in the documentation for examples.

Requirements

APSG requires Python 3.12 or later. It depends on NumPy, SciPy, Matplotlib, SQLAlchemy, pandas, pygeomag. The installers below take care of these.

Installation

Install APSG into a separate environment. Pick one of the options below. uv is the default and the fastest; pip and conda/mamba are alternatives.

Install uv, then create a virtual environment and install APSG into it:

uv venv
uv pip install apsg

Activate the environment on Linux and macOS:

source .venv/bin/activate

On Windows (Command Prompt or PowerShell):

.venv\Scripts\activate

To include JupyterLab and openpyxl (needed to read Excel files), use the lab extra:

uv pip install "apsg[lab]"

In an existing project with a pyproject.toml, add APSG as a dependency instead:

uv add apsg

To use APSG from the command line, install it as a tool. This puts an isolated copy of APSG on your PATH, without activating an environment:

uv tool install apsg

Then start the interactive APSG shell, which runs from apsg import * for you:

iapsg

To try the shell without installing, run uvx --from apsg iapsg. Add the lab extra with uv tool install "apsg[lab]" to include JupyterLab.

Development install

To work on APSG itself, clone the repository and install it in editable mode with all extras and development tools:

git clone https://github.com/ondrolexa/apsg.git
cd apsg
uv sync --all-extras --dev

Run the test suite with uv run pytest.

With pip

Create and activate a virtual environment. On Linux and macOS:

python -m venv .venv
source .venv/bin/activate

On Windows (Command Prompt or PowerShell):

python -m venv .venv
.venv\Scripts\activate

Note: On Windows, PowerShell may refuse to run the activation script. To allow it for the current user, run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Install the latest stable release from PyPI:

pip install apsg

To include JupyterLab and openpyxl (needed to read Excel files), use the lab extra:

pip install "apsg[lab]"

To upgrade an existing installation without touching its dependencies:

pip install --upgrade --no-deps apsg

To install the master branch from GitHub:

pip install git+https://github.com/ondrolexa/apsg.git

With conda or mamba

If you already use conda or mamba, add the conda-forge channel and create an environment with APSG:

conda config --add channels conda-forge
conda create -n apsg python apsg jupyterlab

or with mamba:

mamba create -n apsg python apsg jupyterlab

To install APSG into an existing environment, run conda install apsg (or mamba install apsg).

Current release

Name Downloads Version Platforms
Conda Recipe Conda Downloads Conda Version Conda Platforms

Documentation

Explore all features of APSG in the documentation.

Contributing

Most discussion happens on GitHub. Feel free to open an issue or comment on any open issue or pull request. See CONTRIBUTING.md for more details.

Donate

APSG is an open-source project, available for free. It took a lot of time and resources to build this software. If you find it useful and want to support its future development, please consider donating.

Donate via PayPal

License

APSG is free software: you can redistribute it and/or modify it under the terms of the MIT License. A copy of this license is provided in the LICENSE file.

Metadata

Release files for apsg 2.0.3

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

Source distribution (sdist)

Source distribution for apsg 2.0.3
File Size Uploaded
apsg-2.0.3.tar.gz 200.5 kB Details

Built distribution (wheel)

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

Total release size: 360.1 kB

Release files / apsg-2.0.3.tar.gz

Download URL apsg-2.0.3.tar.gz
Size 200.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3dd2ea697eaa456c27f014bdea102b9b9f816b0506e804c44420bfc528313f0e
BLAKE2b-256 checksum
How to use checksums
1bc0765d7c71899b4854bd738de34a1790d56a81d2f87cc50433ae230c0f066e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","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}

Release files / apsg-2.0.3-py3-none-any.whl

Download URL apsg-2.0.3-py3-none-any.whl
Size 159.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b42f91cbdf1140e39b46c5b61a82051b188bbf2ce3e26c1a3d1951625d576e9
BLAKE2b-256 checksum
How to use checksums
c0abe0cf10ecca398237052dfde927a476515622ff6b6635e5c7252c6f5ab43c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","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}

Release history Release notifications | RSS feed

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

1 release file

0.5.0

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

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