semvec/pypi-packages huggingface dataset:
openmc-data-to-json 0.1.4
A tool for selectively extracting cross sections from OpenMC h5 files.

This is a minimal Python package that provides both command line and API 
interfaces for converting OpenMC h5 nuclear data files into JSON files for each
reaction.

This is useful for building a nuclear data database where JSON files are
commonly accepted inputs. This tool is used for the generation of the
[xsplot.com](http:/www.xsplot.com) database.


# Python API usage

Extracting a single reaction from the h5 file using the API and saving as a
CSV or JSON file.

```python
import openmc_data_to_json as odj

odj.cross_section_from_h5_to_file(
    input='Li6.h5',
    output='tritium_production.json',
    reaction='(n,Xt)',
    format='json'  # csv is also acceptable
)
```

It is also possible to return the h5 info as a dictionary with keys for
'cross section', 'energy', 'element' and other info on the nuclius

```python
import openmc_data_to_json as odj

reaction = odj.cross_section_from_h5_to_dict(
    input='Be9.h5',
    reaction='(n,2n)'
)
```

A h5 file can be checked for reactions to see if particular reactions exist

```python
import openmc_data_to_json as odj

reaction = odj.reactions_in_h5(
    input='Fe56.h5',
    reaction='(n,g)'
)
```


# Command line usage

Another use of this program is to extract reactions using the command line tool.

```bash
openmc-data-to-json -i Be9.h5 -r (n,2n) -o my_reaction.json
```

- the ```-i``` or ```--input``` argument specifies the input h5 file
- the ```-o``` or ```--output``` argument specifies the output json filename
- the ```-r``` or ```--reaction``` argument specifies the reactions to extract.

# Installation

The easiest way to install is to use the PyPi distribution.

```bash
pip install openmc_data_to_json
```
hkscs-unicode-converter 1.1.0
Convert HKSCS codepoints to corresponding new codepoints in Unicode 4.1 onwards
Requires Python: >=3.7

# hkscs-unicode-converter

**hkscs-unicode-converter** is a utility for converting HKSCS characters assigned to Private Use Areas of Unicode to their equivalents in Unicode 4.1 onwards. Inspired by the [npm module](https://www.npmjs.com/package/hkscs_unicode_converter) of the same name.

```python
>>> from hkscs_unicode_converter import converter
>>> converter.convert_string("亂廿四") # Convert an entire string
'亂噏廿四'
>>> converter.convert_char("") # Convert a single character
'嘅'
>>> converter.convert_char(chr(0xE7D4)) # Convert from codepoint
'啱'
>>> converter.convert_char("\uE7D4") # Convert from Unicode literal
'啱'
>>> hex(ord(converter.convert_char(chr(0xE7D4)))) # Get corresponding codepoint
'0x5571'
```

## Installing

hkscs-unicode-converter is [available on PyPI](https://pypi.org/project/hkscs-unicode-converter/1.0.0/) and officially supports Python 3.7+:

```console
$ python3 -m pip install hkscs-unicode-converter
```

## Tests

Tests are located in the hkscs_unicode_converter submodule. Testing uses [tox](https://tox.readthedocs.io/en/latest/) to automate environment management and the built-in [unittest](https://docs.python.org/3/library/unittest.html) framework to run tests.

```console
$ tox
```

## Style Guide

Run [black](https://github.com/psf/black) before committing to master!
roclient 0.0.2
Roblox wrapper, with support for the game client
Requires Python: >=3.6

# roclient
Python Roblox wrapper, primarily focused on the game client.

Since this module doesn't directly hook into the client, it is limited by the following things:
- It can only interact with one client at a time
- Keystrokes may fail to register in time, causing chat messages to cut off
- .wait_for relies on screenshots, making it somewhat unreliable

DM me if you know of a way to send keystrokes to the client, without focusing the window.

# Setup
```bash
pip install -U roclient
```

# Usage
```python
import rockblox
from time import sleep

mutex = rockblox.ClientMutex() # allows multiple clients to be open at once

# create new session using cookie.txt
with open("cookie.txt") as f:
  session = rockblox.Session(f.read().strip())

with rockblox.Client(session, 1818) as client:
  client.wait_for(15) # wait up to 15 seconds for game to load
  print(f"Joined game with {session.name}")
  client.chat_message("burger")
  sleep(1)
  client.screenshot().show()
```

# Documentation
### Session(ROBLOSECURITY, requests_session=None, user_agent=DEFAULT, proxy_url=None, host="roblox.com")
Creates a new session instance.

### ClientMutex()
Takes control of the client mutex, so that multiple client instances can be open at the same time. Won't work if an instance is already open before it is called.

### Client(session, place_id, job_id=None, client_path=default)
Creates a new client instance.

### Client.wait_for(timeout=15, check_interval=0.25, ignore_colors=\[(0, 0, 0) (45, 45, 45)])
Waits until the client is past the loading screen. This uses the screenshot method and therefore may not be 100% reliable.

### Client.screenshot() -> PIL.Image
Returns a `PIL.Image` screenshot of the client in it's current window size.

### Client.press_key(key)
Simulates a key press on the client, using the provided vk code.

### Client.release_key(key)
Simulates a key release on the client, using the provided vk code.

### Client.chat_message(message)
Attempts to write and send a chat message by simulating keystrokes on the client.

### Client.close()
Kills the client process.