Metadata-Version: 2.1
Name: procurement-tools
Version: 0.1.5
Summary: Python tools for navigating federal contracting
Home-page: https://pypi.org/project/procurement-tools/
License: Apache-2.0
Keywords: packaging,poetry
Author: V. David Zvenyach
Author-email: dave@tandemgov.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: beautifulsoup4 (>=4.12.2,<5.0.0)
Requires-Dist: cssselect (>=1.2.0,<2.0.0)
Requires-Dist: httpx (>=0.25.2,<0.26.0)
Requires-Dist: keyring (>=24.3.0,<25.0.0)
Requires-Dist: pydantic (>=2.5.1,<3.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: rich (>=13.7.0,<14.0.0)
Requires-Dist: typer (>=0.9.0,<0.10.0)
Project-URL: Documentation, https://procurement-tools.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/tandemgov/procurement-tools
Description-Content-Type: text/markdown

# procurement-tools

[![PyPI version](https://img.shields.io/pypi/v/procurement-tools.svg)](https://pypi.org/project/procurement-tools/)

A handy collection of python utilities and tools to navigate federal contracting.

## Features

- [x] UEI validation
- [x] Get a URL for an entity from USASpending
- [x] Get recent award data for an entity from USASpending
- [x] Lookup a FAR provision by citation
- [x] Get entity information from the SAM entity
- [x] Access innovations from the Periodic Table of Acquisition Innovations

## Usage

For full documentation, head to [the docs](https://procurement-tools.readthedocs.io/en/latest/).

```py
from procurement_tools import FAR, UEI, USASpending, PeriodicTable
print(UEI.is_valid("J7M9HPTGJ1S9"))
# True

print(USASpending.get_usaspending_URL("J7M9HPTGJ1S9"))
# 'https://www.usaspending.gov/recipient/bf1220c1-2373-042a-e8e1-33d5a29639d0-P/latest'

print(FAR.get_section("17.502-2"))
# Returns a pydantic model with the title, section number, url, and text of the section

print(PeriodicTable.get_random_innovation())
# Returns a dict with an innovation from the FAI Periodic Table of Acquisition Innovations
```

Additionally, we have the beginning of a SAM API client:

```python
from procurement_tools import get_entity
res = get_entity({"ueiSAM":"XRVFU3YRA2U5"})
print(res)
# Returns a pydantic model with the latest SAM data for a given Entity
```

## CLI Usage

# `fargo`

**Usage**:

```console
$ fargo [OPTIONS] COMMAND [ARGS]...
```

**Options**:

- `--install-completion`: Install completion for the current shell.
- `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
- `--help`: Show this message and exit.

**Commands**:

- `far`: Get a provision of the FAR
- `sam`: Get a SAM entity's JSON data by providing...
- `usaspending`: Get JSON data about an entity from...

## `fargo far`

Get a provision of the FAR

**Usage**:

```console
$ fargo far [OPTIONS] SECTION_NUMBER
```

**Arguments**:

- `SECTION_NUMBER`: [required]

**Options**:

- `--help`: Show this message and exit.

## `fargo sam`

Get a SAM entity's JSON data by providing a UEI

**Usage**:

```console
$ fargo sam [OPTIONS] UEI
```

**Arguments**:

- `UEI`: [required]

**Options**:

- `--help`: Show this message and exit.

## `fargo usaspending`

Get JSON data about an entity from USASpending by providing a UEI

**Usage**:

```console
$ fargo usaspending [OPTIONS] UEI
```

**Arguments**:

- `UEI`: [required]

**Options**:

- `--awards / --no-awards`: [default: no-awards]
- `--help`: Show this message and exit.

## Installation

```sh
pip install procurement-tools
```

## License

Apache 2.0

