semvec/pypi-packages huggingface dataset:
django-sql-middleware 0.0.7
Simple SQL Middleware for Django
Requires Python: >=3.6

# Django SQL Middleware

A simple middleware aimed to capture all queries in a request and provide basic SQL profiling such
as execution time, execution plan, and query traceback.

This package is only intended to run in development mode for non-sqlite database.

Currently, this package only tested in projects that uses psycopg2 (postgres) as default database engine.

## How To Install

1.  Get the package from pypi: `pip install django-sql-middleware`
2.  In `settings.py` add:

    ```
    INSTALLED_APPS = [
        # your other apps
        "sqlmiddleware"
    ]

    MIDDLEWARE = [
        # your other middlewares
    ]

    if DEBUG:
        MIDDLEWARE.append("sqlmiddleware.middlewares.LogSQLMiddleware")
    ```

3.  Register urls in `your_project/urls.py`:

    ```
    from django.urls import include, path

    urlpatterns = [
        # other urls,
        path("__sql/", include("sqlmiddleware.urls")),
    ]
    ```

4.  Run `collectstatic` to serve included css and js assets: `./manage.py collectstatic`
5.  Start the development server: `./manage.py runserver`
6.  you should be able to access `localhost:8000/__sql` in your browser.
jrImgTools 0.3.3
Image utility functions for personal use

# jxImgTools
A simple toolbox for processing and visualizing medical images. 

## Functions
### Visualization
#### VolSlice
A tool to visualize 3D volume and segmentations in the same time.
```python
# Create fake data
import numpy as np
import matplotlib.pyplot as plt
vol = np.zeros((50, 128, 128))
vol[20:30, 40:88, 40:88] = 1
vol += 0.1*np.random.rand(*vol.shape)
# plt.imshow(vol[25,:,:], cmap='gray')

seg1 = np.zeros((50, 128, 128))
seg1[20:30, 40:88, 40:88] = 1

seg2 = np.zeros((50, 128, 128))
seg2[20:29, 45:95, 45:95] = 1
seg2[29, 40:88, 40:88] = 1

fig, axs = plt.subplots(1,3)
axs[0].imshow(np.squeeze(vol[25,:,:]), cmap='gray')
axs[1].imshow(np.squeeze(seg1[25,:,:]), cmap='gray')
axs[2].imshow(np.squeeze(seg2[25,:,:]), cmap='gray')

# Visualize using VolSlicer
from jximgtools.metric import dicePerSlice, dice
from jximgtools.visualization.volSlicer import VolSlicer

dicee = dice(seg1, seg2)
dices = dicePerSlice(seg1, seg2)
volInfo = {'Name': 'Test Volume', 'DicePerSlice': dices}
slicesInfo = [{'Dice': dices[sliceIdx]} for sliceIdx in range(50)]
VolSlicer(vol, volInfo = volInfo, segs = [seg1, seg2], slicesInfo = slicesInfo)

```

## Installation
```bash
pip install jximgtools
```
textprep 0.0.3
One-stop text preprocessing package for NLP algorithm.
Requires Python: >=3.6

# textprep
One-stop text preprocessing package for NLP algorithm. 

`from textprep import textprep` \
`text1 = text1` \
`text2 = textprep.textprep(text1)`

* Fix contractions.
* Remove punctuation.
* Convert to lowercase.
* Remove stopwords.
* Lemmatitztion.
pybotsentinel 0.0.2
A package to programmatically query a twitter user on BotSentinel
Requires Python: >=3.6

# PyBotSentinel

PyBotSentinel is an API wrapper for [BotSentinel](https://botsentinel.com). It's simple in functionality as at this point,
it only provides you a rating, and the description of what that rating means to
BotSentinel.

### Requirements

This requires Python 3.6 and above, and was built on Python 3.8. It requires
requests, ScraPy

### Installation
I recommend you install this via pip3 ([PyPi](https://pip.pypa.io/en/stable/installing/))

```bash
$ pip3 install pybotsentinel
```

### Getting Started and Finished

```python
import pybotsentinel
query = pybotsentinel.PyBotSentinel()


rating = query.get_bot_rating('realdonaldtrump')
>>> rating
[True, 30, 'Moderate', 'Our analysis has concluded realdonaldtrump exhibits moderate tweet activity and is not a trollbot account.']
```

### Troubleshooting

If you end up getting an occasional 403 while querying, it's most likely due to a race condition
as a result of making the GET request to the page to get the one-time-key
for BotSentinel's backend API, the next key generates before the POST call is made,
the POST call to the API is made, and the API returns a JSON object of {'success': False,
'bot_rating': 'INCORRECT_DATA'} with a HTTP status code code of 403. If a
 subsequent query is made for the same user, it will succeed and return the user's bot
 rating.
py3botsentinel 0.0.1
A package to programmatically query a twitter user on BotSentinel
Requires Python: >=3.6

# Py3BotSentinel

PyBotSentinel is an API wrapper for [BotSentinel](https://botsentinel.com). It's simple in functionality as at this point,
it only provides you a rating, and the description of what that rating means to
BotSentinel.

### Requirements

This requires Python 3.6 and above, and was built on Python 3.8. It requires
requests, ScraPy

### Installation
I recommend you install this via pip3 ([PyPi](https://pip.pypa.io/en/stable/installing/))

```bash
$ pip3 install py3botsentinel
```

### Getting Started and Finished

```python
import pybotsentinel
query = pybotsentinel.PyBotSentinel()


rating = query.get_bot_rating('realdonaldtrump')
>>> rating
[True, 30, 'Moderate', 'Our analysis has concluded realdonaldtrump exhibits moderate tweet activity and is not a trollbot account.']
```

### Troubleshooting

If you end up getting an occasional 403 while querying, it's most likely due to a race condition
as a result of making the GET request to the page to get the one-time-key
for BotSentinel's backend API, the next key generates before the POST call is made,
the POST call to the API is made, and the API returns a JSON object of {'success': False,
'bot_rating': 'INCORRECT_DATA'} with a HTTP status code code of 403. If a
 subsequent query is made for the same user, it will succeed and return the user's bot
 rating.