semvec/pypi-packages huggingface dataset:
spcalc 2.0.0
Stratergy Pattern Calculator

[![Python application test with Github Actions](https://github.com/yrangana/Strategy_Pattern_Calculator/actions/workflows/main.yml/badge.svg)](https://github.com/yrangana/Strategy_Pattern_Calculator/actions/workflows/main.yml)

# Strategy Pattern Calculator
Python implementation of a command line calculator using the strategy design pattern 

## Description
This is a simple command-line calculator that can perform basic arithmetic operations. The calculator is implemented using the strategy design pattern. The calculator can perform the following operations:

- Addition
- Subtraction
- Multiplication
- Division

### To be implemented:

- Setup tool to install the calculator as a package
- Exponentiation
- Square root
- Logarithm

## Getting Started

### Installing
- Clone the repository
```
git clone https://github.com/yrangana/Strategy_Pattern_Calculator.git
```
- Install the dependencies
```
make install
```

### Executing program in python

- Run the calculator with prompts
```
python src/main.py
```

- Run the calculator with arguments
```
python src/main.py -n1 <first number> -n2 <second number> -op <operation>
```

- Run the tests
```
make test
```

### Executing program in CLI

- Setup as a Command Line Tool
```
python -m pip install --editable .
```

- Run the calculator with prompts
```
spcalc
```

- Run the calculator with arguments
```
spcalc -n1 <first number> -n2 <second number> -op <operation>
```



## Help

```
Usage: main.py [OPTIONS]

Options:
  -n1, --num1 FLOAT               First number
  -n2, --num2 FLOAT               Second number
  -op, --operation [add|subtract|multiply|divide]
                                  Operation to perform
  --help                          Show this message and exit.
```

## Authors
[Yasiru Rangana](https://github.com/yrangana)

## Version History
* V1.0.0
    * [Initial Release as a Command Line Tool](https://github.com/yrangana/Strategy_Pattern_Calculator/releases/tag/V1.0.0)
* V1.1.0
    * [Minor Bugs were fixed](https://github.com/yrangana/Strategy_Pattern_Calculator/releases/tag/V1.1.0)
 
* V1.2.0
    * [Minor Improvements](https://github.com/yrangana/Strategy_Pattern_Calculator/releases/tag/V1.2.0)

## License
This project is licensed under the MIT License - see the [License](LICENSE) file for details
fastshuffle 1.0.1
Quickly shuffle parallel corpora
Requires Python: >=3.7

# FastShuffle

A memory efficient Python module to quickly shuffle parallel text corpora. The main advantage is that it never loads the entire dataset in memory, using memory-mapped file offsets instead.

## Installation

```bash
pip install fastshuffle
```

## Usage

```python
from fastshuffle import file_shuffle

src, tgt = file_shuffle("source.txt", "target.txt")
print(src, tgt)
# source.txt.shuffled target.txt.shuffled
```

You can also simultaneously sample/isolate a certain number of sentences from the dataset (which are then removed from the shuffled result)

```
from fastshuffle import file_shuffle_sample

src, tgt, src_sample, tgt_sample = file_shuffle("source.txt", "target.txt", 5) # Sample 5 sentences
print(src, tgt, src_sample, tgt_sample)
# source.txt.shuffled target.txt.shuffled source.txt.shuffled.sample target.txt.shuffled.sample
```

## Notes

Source and target must have the same number of lines. No validation checks are made.

## Build

```bash
git clone https://github.com/LibreTranslate/FastShuffle
cd FastShuffle
python setup.py build
```

## Standalone Binary

You can also use fastshuffle as a standalone Windows, macOS or Linux application (but you currently need to build from source, we don't provide binaries).

```
mkdir build
cd build && cmake .. && make -j4
./shuffle source.txt target.txt
```

## Contributing

We welcome pull requests!

## License

AGPLv3
render-engine-json 2024.1.1a2
JSON Parser and Collection for Render Engine
Requires Python: >=3.10

# Render Engine JSON

JSON Parser and Collection Module for Render Engine

## Installation

```bash
pip install render_engine_json
```

## Usage

The `render-engine-json` extends render-engine to allow you to build pages and collections using JSON. 

The `JSONPageParser` class can be used to parse a single JSON page and the `JSONCollection` class can be used to parse a single collection of JSON pages.

> **NOTE**
> The `JSONCollection` class is designed to work with a single JSON file that contains an array of JSON Objects or a JSON Hash where the keys are the slugs. If you want to work with multiple JSON files you can use a regular `Collection` and the `JSONPageParser` as the parser.

### Single JSON Page Entry

To create a json entry you will need the `JSONPageParser` class as the Parser for your `Page` Object.

You can pass the page a json string or a json file path.

#### As a string

```python

from render_engine import Page, Site
from render_engine_json import JSONPageParser

site = Site()

json_page = """
{
    "title": "My JSON Page",
    "content": "This is my json page"
}
"""

@site.page
class JSONStringPage(Page):
    parser = JSONPageParser
    content = json_page

```

#### As a file

```python

@site.page
class JSONFilePage(Page):
    parser = JSONPageParser
    content_path = "path/to/json/file.json"

```

```


```