semvec/pypi-packages huggingface dataset:
graphs-HDoubleH2 0.0.1
A small example package
Requires Python: >=3.7

# HDoubleH's Graphs Algorithm Library

This package implements two graph algorithms in python, including **Dijkstra's Shortest Path Algorithm** and **Tarjan's Algorithm for Strongly Connected Components**.

Graphs are data structures which connect nodes identified by labels. 

- **Dijkstra's Shortest Path Algorithm**: This computes the shortest path from a single source node to all the other nodes in a graph. It will find the shortest path from a single source node to all other nodes in a weighted graph with non-negative edge weights. It operates by iteratively expanding the node with the smallest known distance and updating the distances to its neighbors.

- **Tarjan's Algorithm for Strongly Connected Components**: This algorithm detects all the strongly connected components (SCCs) in a directed graph using a depth-first search. Each SCC is a maximal subgraph where every node is reachable from every other node in the same subgraph. 

## Usage

**Dijkstra's Shortest Path Algorithm**- 
Create a file with the following named filename.py
````
```
from graphs_HDoubleH import sp
import sys

if __name__ == '__main__':
    
    if len(sys.argv) != 2:
        print(f'Use: {sys.argv[0]} graph_file')
        sys.exit(1)

    graph = {}
    with open(sys.argv[1], 'rt') as f:
        f.readline() # skip first line
        for line in f:
            line = line.strip()
            s, d, w = line.split()
            s = int(s)
            d = int(d)
            w = int(w)
            if s not in graph:
                graph[s] = {}
            graph[s][d] = w
    
    s = 0
    dist, path = sp.dijkstra(graph, s)
    print(f'Shortest distances from {s}:')
    print(dist)
    for d in path: 
        print(f'spf to {d}: {path[d]}')
```
````

To run this enter the following in the terminal

```
python src/filename graph.txt

```
**Tarjan's Algorithm for Strongly Connected Components**- 

Create a file with the following named tarjan_filename.py 

````
```

import sys
from graphs_HDoubleH import tarjan  # Import Tarjan's Algorithm

if __name__ == '__main__':
    
    if len(sys.argv) != 2:
        print(f'Use: {sys.argv[0]} graph_file')
        sys.exit(1)

    # Load graph from the file
    graph = {}
    with open(sys.argv[1], 'rt') as f:
        f.readline()  # skip the first line
        for line in f:
            line = line.strip()
            s, d, w = line.split()
            s = int(s)
            d = int(d)
            w = int(w)
            if s not in graph:
                graph[s] = {}
            graph[s][d] = w

    # Run Tarjan's Algorithm to find SCCs
    sccs = tarjan.tarjan_scc(graph)
    
    # Output the results
    print(f'Strongly Connected Components (SCCs): {sccs}')

```
````

To run this enter the following in the terminal

```

python src/tarjan_filename.py graph.txt

```

### Installation 
Package can be installed with - pip3 install graphs_HDoubleH2
one-password-utils 0.1.5rc0
1Password_Utility is a Python package providing utility functions for interacting with 1Password via the command-line interface (CLI). It simplifies the process of retrieving credentials from 1Password vaults within your Python scripts, making it easier to automate tasks and securely manage sensitive information.
Requires Python: >=3.6

# 1Password_Utility 🚀

A collection of utility functions for interacting with 1Password via the command-line interface (CLI).

## Features ✨

- Retrieve credentials (username and password) from 1Password vaults securely within your Python scripts. 🔒
- Simplifies the process of automating tasks and managing sensitive information. 🤖

## Prerequisites 📋

- **1Password:** You need to have 1Password installed and set up on your system. 
- **1Password CLI (`op`):**  Install the 1Password CLI by following the instructions on the [1Password Developer website](https://developer.1password.com/docs/cli/get-started). 🛠️

## Installation 📥

```bash
pip install 1Password-Utility
```
## Usage

```python
onepassword = __import__('1Password-Utility')

# Retrieve credentials from a 1Password item
item_uuid = "your_item_uuid"  # Replace with the actual UUID of your 1Password item
username, password = onepassword_utils.get_credentials_from_1password(item_uuid)

if username and password:
    print(f"Username: {username}")
    print(f"Password: {password}")
    # ... Use the credentials in your script 🎉
else:
    print("Failed to retrieve credentials.") 😕
```
## Important:⚠️

Make sure you have the 1Password CLI (op) installed and configured correctly before using this package.
Handle the retrieved credentials securely within your scripts. Avoid printing them to the console or storing them in plain text. 🛡️

## Contributing 🤝
Contributions are welcome! Please feel free to submit pull requests or open issues if you find any bugs or have suggestions for improvements. 

## License 📄
This project is licensed under the MIT License - see the LICENSE file for details.   


**Key points:**

- **Clear sections:** The README is organized into clear sections with headings to make it easy to navigate.
- **Prerequisites:** The prerequisites section explicitly mentions the need for 1Password and the 1Password CLI.
- **Installation:** Provides the `pip install` command for easy installation.
- **Usage:** Includes a concise code example demonstrating how to use the `get_credentials_from_1password` function.
- **Important notes:** Highlights important considerations for security and setup.
- **Contributing and License:** Encourages contributions and specifies the license under which the project is released.

Remember to replace placeholders like `your_item_uuid` and `your-username` with your actual values. 

You can further enhance the README by adding more detailed explanations, additional usage examples, or information about any other functions you might include in your `onepassword_utils` package in the future. 

Let me know if you have any other questions or need help with further refinements!