semvec/pypi-packages huggingface dataset:
npsearchsequence 0.10
Sequence / string search with NumPy
License: MIT
Keywords: sequence,search,string,numpy


# Sequence / string search with NumPy

## pip install npsearchsequence

### Tested against Windows 10 / Python 3.11 / Anaconda 


```python
np_search_sequence(a, seq, distance=1):
    """
    Search for the occurrence of a given sequence within a NumPy array.

    Parameters:
    - a (numpy.ndarray): The input NumPy array to search within.
    - seq (numpy.ndarray): The sequence to search for within the array.
    - distance (int, optional): The distance between consecutive elements
      of the sequence in the array. Default is 1.

    Returns:
    numpy.ndarray:
        An array of indices where the given sequence is found in the input array.

    Example:
    seq = np.array([3, 6, 8, 4])
    arr = np.random.randint(0, 9, (1000000,))
    np_search_sequence(a=arr, seq=seq, distance=1)
    array([  8370,  24712,  25143, ..., 999287, 999493, 999805])
	"""
```



```python
np_search_string(string, substring, distance=1):
    r"""
    Search for the occurrence of a given substring within a string using NumPy.

    Parameters:
    - string (str or bytes): The input string to search within.
    - substring (str or bytes): The substring to search for within the string.
    - distance (int, optional): The distance between consecutive characters
      of the substring in the string. Default is 1.

    Returns:
    numpy.ndarray:
        An array of indices where the given substring is found in the input string.

    Example:
    text = '''Welcome! Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Fortunately an experienced programmer in any programming language (whatever it may be) can pick up Python very quickly. It's also easy for beginners to use and learn, so jump in!
    Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python. Even some Windows computers (notably those from HP) now come with Python already installed. If you do need to install Python and aren't confident about the task you can find a few notes on the BeginnersGuide/Download wiki page, but installation is unremarkable on most platforms.'''
    res = np_search_string(string=text*10000, substring='man', distance=1)
    array([  119,   238,   357, ..., 93382, 93533, 93709])
    res2 = np_search_string(string=(text * 10000).encode(), substring=b"man", distance=1)

    """
```
infonegara 0.0.1
Library buat kasi informasi singkat negara.
License: MIT
Keywords: info,negara


# Info Negara

Library Info Negara adalah modul Python yang dirancang untuk berinteraksi dengan REST Countries API. Modul ini menyediakan antarmuka sederhana melalui class libraryNegara untuk mendapatkan informasi penting tentang suatu negara. Dengan memanfaatkan modul requests, library ini mempermudah akses informasi seperti nama negara, ibu kota, mata uang, dan populasi, sehingga memudahkan pengembang untuk mengintegrasikannya ke dalam aplikasi mereka.


## API 

#### Python Basic API wrapper

```http
  https://restcountries.com/v2/
```
## Installation

Install my-project with npm

```bash
  pip install infonegara
```
    
## Usage
Basic Usage:

```javascript
from info_negara import libraryNegara

library_negara = libraryNegara()

nama_negara = input("Masukkan nama negara dengan bahasa inggris: ")
info_negara = library_negara.get_info_negara(nama_negara)

if info_negara:
    print("\nInformasi Negara")
    print(f"Nama Negara: {info_negara.nama}")
    print(f"Ibu Kota: {info_negara.ibukota}")
    print(f"Mata Uang: {info_negara.matauang}")
    print(f"Jumlah Penduduk: {info_negara.populasi}")
    print("")
else:
    print(f"Negara '{nama_negara}' tidak ditemukan.")
    
```