semvec/pypi-packages huggingface dataset:
spacetrack-files 0.0.3
Simple module for ephemeris download and parse
Requires Python: >=3.7
Keywords: spacetrack ephemeris starlink

# spacetrack_files

This module allows you to download and parse Starlink ephemeris files.

## Setup

Simply add this module via `pip`

```
pip install spacetrack_files
```

## Using

You can:

- Download any available public files from SpaceTrack
- Parse Starlink ephemeris

### Downloading public files

### Downloading public files from SpaceTrack

Script below retrieves all public files and downloads them.

```py
import os
from spacetrack_files.api import SpaceTrackApi

api = SpaceTrackApi('your_username', 'your_password')
dirs = api.getDirsList()

base_download_path = '.'

for download_path in dirs:
    if not os.path.exists(download_path):
        os.mkdir(download_path)

    fs = api.getDirsWithFiles()
    downloading_files = fs[download_path]

    for file in downloading_files:
        file_download_path = os.path.join(base_download_path, download_path, file)
        if os.path.exists(file_download_path):
            continue
        api.downloadFile(file, file_download_path)
```

### Parsing Starlink ephemeris

It's as simple as this:

```py
from spacetrack_files.files import EphemerisFile

# DO NOT RENAME FILE
eph = EphemerisFile('MEME_54190_STARLINK-5281_2210828_Operational_1375864140_UNCLASSIFIED.txt') 
```

Keep in mind: module's using filename to parse satellite name, NORAD ID, classification and operational status. **Thus do not rename file**.

Ephemeris structure:

```py
@dataclass
class Ephemeris:
    epoch_j2000: str
    epoch: datetime
    position: np.array
    speed: np.array
    corr_values: np.array
```

Variables `position` and `speed` are 3-dim vectors. `corr_values` is matrix 3x7.

You can also get ephemeris in DataFrame format:

```py
df = eph.to_dataframe()
```
python-algorithm-pyal 1.0.0
Python does not have some useful or important data structures, like linked list, tree map, just like STL in C++. This library, PYthon Algorithm Library (pyal), aims to provide a python version substitue of STL in C++.
Requires Python: >=3.6

# PYthon Algorithms Library

Python does not have some useful or important data structures, like linked list, tree map, just like STL in C++. 
This library, PYthon Algorithm Library (pyal), aims to provide a python version substitue of STL in C++.

# 1. Install

# 2. Examples

Balanced search tree based map, ```TreeMap```

```python
import pyal

tree_map = pyal.TreeMap()
data = [(0, "a"), (1, "b"), (2, "c"), (3, "d"), (4, "e"), (5, "f")]
for key, value in data:
    tree_map.set(key, value)

key = 0
print(f"{key=}, value={tree_map.get(key)=}")

key = 1
node = tree_map.lower_bound(key)
print(f"lower_bound({key=}): {node()=}")
print(f"upper_bound({key=}): {node.next()()=}")

print(f"min key: {tree_map.key_list_begin()()}")
print(f"max key: {tree_map.key_list_end().prev()()}")

```

Output
```
key=0, value=tree_map.get(key)='a'
lower_bound(key=1): node()=1
upper_bound(key=1): node.next()()=2
min key: 0
max key: 5
```


# 3. Popular data structures and algorithms.
  * Tree
    >* TreeMap [example](doc/example_TreeMap.md)
    >   * balanced AVL tree, `insert` & `delete`: O(log N), `get`: O(1)
    >* DaynamicHeap [example](doc/example_DynamicHeap.md)
    >   * `update`, `deletion`: O(log N)
    >* MinHeap [example](doc/example_MinHeap.md)
    >* DisjointSet [example](doc/example_DisjointSet.md)
  * list
    > * LinkedList [example](doc/example_DisjointSet.md)
    > * Queue [example](doc/example_DisjointSet.md)
    > * Dequeue [example](doc/example_DisjointSet.md)
    > * Stack [example](doc/example_DisjointSet.md)
    > * LRUCache [example](doc/example_DisjointSet.md)
    >   * `get` & `set`: O(1)
    > * LFUCache [example](doc/example_DisjointSet.md)
    >   * `get` & `set`: O(1) 
  * String
  * Graph
  * Common useful functions.