semvec/pypi-packages huggingface dataset:
sam-us-zipcode-gecode 5
A Python package for converting US zip codes to latitude and longitude

# sam-us-zipcode-gecode

sam-us-zipcode-gecode is a Python package for caching zip code information. It creates a cache of zip code information from a JSON file and stores it as individual files in a directory for faster access.

## Installation

You can install sam-us-zipcode-gecode using pip:


```bash
pip install sam-us-zipcode-gecode


```


## Usage

Here's an example of how to use Zip Cache:

```python
from zip_cache import ZipCache


# Get data for a zip code
data = cache.get_data("96105")
print(data)
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)
comboparse 1.0.1
Drop-in replacement for argparse with support for environment variables.
Requires Python: >=3.10

# comboparse

Drop-in replacement for argparse with support for environment variables.

## How does it work

If environment variables are present that fit a certain schema they are internally appended
as if you had added them as CLI arguments.

## Usage

As a drop in replacement just use comboparser instead of argparse:

```python
import comboparse

# notice the different classname its not argparse.ArgumentParser
parser = comboparse.ComboParser(
                    prog='ProgramName',
                    description='What the program does',
                    epilog='Text at the bottom of help')

parser.add_argument('filename')           
parser.add_argument('-c', '--count')      
parser.add_argument('-v', '--verbose',
                    action='store_true') 

args = parser.parse_args()
```

If the environment variables FILENAME, COUNT or VERBOSE (for flags set them with 1, true or y) these
values will be set accordingly

### Prefix environment variables

Obviously for the sake of sanity we might want to prefix our environment variables, simply add
the following parameter to the constructor:

```python
import comboparse

# notice the different classname its not argparse.ArgumentParser
parser = comboparse.ComboParser(
    # ...
    env_prefix="combo", # please note that this will be upper cased
)

# ...
```

and now the env vars from before would be COMBO_FILENAME, COMBO_COUNT, COMBO_VERBOSE

## Limitations

### Environment variable names

The names can't be adjusted beyond setting the prefix and determined by the actions "dest" value.
Aka whatever argparse would determine your "args.NAME" to be like.

### Mixing CLI arguments and environment variables

While this should work as this tool simply adds its own CLI arguments to argparser, if you
do something like

```bash
$ COUNT=10 my-tool --count 5 --verbose
```

The verbose flag will work as expected, but which count is taken isn't guaranteed by thiis library.
(aka while now maybe the environment variable has precedence, in the future this might randomly
change so don't rely on this!)

### Action Type: count

Count actions are usually provided like this:

```bash
$ my-cli-tool -vvv
Namespace(verbose=3)
```

but as an env variable you have to provide the number as is

```bash
$ VERBOSE=3 my-cli-tool
Namespace(verbose=3)
```

### Action Type: append_const

This works a bit like a normal store_true/store_false you have to use 1, true etc.

## License

MIT
diffcord 1.0.3
A Python wrapper for the Diffcord API written in Python.
Requires Python: >=3.7.0
Keywords: diffcord,diffcord-api,diffcord-api-wrapper,diffcord-api-python-wrapper,diffcord-api-python

# Diffcord Python SDK

A Python wrapper for the Diffcord API written in Python. 

## Installation
```
pip install diffcord
```


## Pycord Example

```python
from diffcord import Client, VoteWebhookListener, UserBotVote, UserVoteInformation

import discord

intents = discord.Intents.default()

bot = discord.Bot(intents=intents)


async def send_stats_success():
    """ Handle stats successfully sent to Diffcord
    """
    print("Stats sent successfully!")


async def send_stats_failure(e: Exception) -> None:
    """ Handle stats failed to send to Diffcord error
    """
    print("Stats failed to send:", e)


async def on_vote(vote: UserBotVote) -> None:
    """ Handle the vote.
    """
    # LOGIC HERE... (give rewards, etc.)

    # example: send a DM to the user who voted
    user = await bot.fetch_user(vote.user_id)  # Get the discord user object from the user id
    await user.send("Thanks for voting!")  # Send a DM to the user who voted


# create Diffcord client & webhook listener

# "port" represents the port to listen on for incoming vote webhooks from Diffcord, choose any port you would like which is not in use
diff_webhook_listener = VoteWebhookListener(port=8080, handle_vote=on_vote, verify_code="WEBHOOK_AUTH_CODE_HERE")

diff_client = Client(bot, "YOUR_DIFFCORD_API_TOKEN", diff_webhook_listener,
                     send_stats_success=send_stats_success, send_stats_failure=send_stats_failure)

bot.diff_client = diff_client

# on startup event
@bot.event
async def on_ready():
    # start the webhook listener & start send stats
    await diff_client.start()  # required


@bot.slash_command(name="example")
async def example_command(ctx):
    # get user vote info
    user_vote_info: UserVoteInformation = await diff_client.get_user_vote_info(ctx.author.id)

    # get amount of bot votes this month
    bot_votes_this_month: int = await diff_client.bot_votes_this_month()

    # respond
    message = f"You have voted {user_vote_info.monthly_votes} times this month! This bot has {bot_votes_this_month} votes this month!"
    await ctx.respond(message)


bot.run("YOUR_BOT_TOKEN")
```