semvec/pypi-packages huggingface dataset:
py-xbc 0.1.2
A library for manipulating eXtra BootConfig (XBC) files
Requires Python: >=3.7
Keywords: bootconfig,xbc,configuration

# py-xbc

`py-xbc` is a pure-Python library for reading and writing files in the
eXtra BootConfig (XBC) file format specified by the Linux kernel. This
is not a strictly-conforming implementation: in particular, this
implementation does not enforce the 32,767-byte ceiling on XBC files,
nor does it enforce the 16-level cap on keys and blocks.

# Requirements

`py-xbc` currently requires `pyparsing` and Python 3.7+.

# Usage

`py-xbc` exports four functions:

- `loads_xbc` parses a string.
- `load_xbc` opens a file and then parses a string.
- `saves_xbc` renders to a string.
- `save_xbc` renders to a string and writes the string to a file.

## Format

XBC files consist of a series of statements, of which there are three
kinds:

- A key is a sequence of one or more bytes in the range `a-zA-Z0-9_-`.
  They are namespaced with periods (`.`) and may be followed by an
  equals sign (`=`). Key statements are terminated by a semicolon (`;`),
  a linefeed, or a semicolon followed by a linefeed.

- A key/value statement is a key followed by an operator, followed in
  turn by one or more values. There are three operators:

  - Assignment (`=`) specifies an initial value.
  - Updates (`:=`) overwrites whatever value was previously there.
  - Appends (`+=`) appends one or more values.

  There are two kinds of values: strings and arrays. Strings can be
  either 'bare' or quoted.

  - Bare strings are a sequence of one or more bytes that are not in the
    range `{}#=+:;,\n'" `.
  - Quoted strings are a sequence of bytes that begins with a single
    quote (`'`) or a double quote (`"`) and ends only with the same
    quote. Quotes cannot be escaped.
  - Arrays are a sequence of one or more values delimited by a comma
    (`,`).

- A block is a key followed by a pair of curly braces, inside which is
  one or more key or key/value statements.

Keys are composable. The following examples are equivalent:

```xbc
foo {
    bar {
        fluff = 1
    }
}
# is equivalent to
foo.bar.fluff = 1
# is equivalent to
foo.bar { fluff = 1 }
# is equivalent to
foo { bar.fluff = 1 }
```

# Licence

`py-xbc` is published under the MIT license. See `LICENSE.txt` for more
information.
geoproximity 0.1
A Python package for geospatial distance calculations and proximity-related functions.

### GeoProximity Package Usage Guide

#### Introduction

GeoProximity is a Python package designed to facilitate geospatial distance calculations, point projections, and related operations. It includes functions for both Haversine distance (great-circle distance) and Euclidean distance calculations. GeoProximity is suitable for applications that require proximity analysis, spatial operations, and basic geospatial functionality.

#### Installation

Ensure Python is installed on your system, then install the `geoproximity` package using `pip`:

```sh
pip install geoproximity
```

#### Calculate harversine distance
```python
import geoproximity
geoproximity.haversine_distance(coord1, coord2)
```
It returns the haversine distance between two points in km.

#### Find the nearest neighbor from the list of coordinates to the referece point
```python
geoproximity.nearest_neighbor(reference_point, coordinates_list)
```
It returns a tuple containing the nearest point and distance of the nearest point from the reference point in km.

Example:
```python
reference_point = (37.7749, -122.4194)
other_points = [(34.0522, -118.2437), (40.7128, -74.0060), (41.8781, -87.6298)]

nearest_point, min_distance = geoproximity.nearest_neighbor(reference_point, other_points)

```
### Calculate the area of a polygon
```python
geoproximity.calculate_polygon_area(polygon_geojson)
```
We need to pass the polygon geojson as a parameter to the `calculate_polygon_area` function. It returns the area of the polygon in square km.