fastrand 3.0.5__cp38-cp38-macosx_10_9_x86_64.whl → 3.0.7__cp38-cp38-macosx_10_9_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fastrand might be problematic. Click here for more details.

@@ -1,22 +1,40 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastrand
3
- Version: 3.0.5
3
+ Version: 3.0.7
4
4
  Summary: Fast random number generation in Python
5
- Author: Daniel Lemire
6
- Author-email: daniel@lemire.me
5
+ Author-email: Daniel Lemire <daniel@lemire.me>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/lemire/fastrand
8
+ Project-URL: Repository, https://github.com/lemire/fastrand
9
+ Project-URL: Issues, https://github.com/lemire/fastrand/issues
10
+ Keywords: random,random-number-generator,pcg,xorshift,performance
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: C
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Requires-Python: >=3.8
7
25
  Description-Content-Type: text/markdown
8
26
  License-File: LICENSE
9
27
 
10
28
  # fastrand
11
29
 
12
- Fast random number generation in an interval in Python using PCG: Up to 10x faster than random.randint.
30
+ Fast random number generation in an interval in Python: Up to 10x faster than random.randint.
13
31
 
14
32
  Blog post: [Ranged random-number generation is slow in Python](https://lemire.me/blog/2016/03/21/ranged-random-number-generation-is-slow-in-python/)
15
33
 
16
34
 
17
35
 
18
36
 
19
- Usage... (don't forget to type the above lines in your shell!)
37
+ Usage...
20
38
 
21
39
  ```python
22
40
  import fastrand
@@ -27,6 +45,8 @@ print("generate an integer in [100,1000]")
27
45
  fastrand.pcg32randint(100,1000) # requires Python 3.7 or better
28
46
  print("Generate a random 32-bit integer.")
29
47
  fastrand.pcg32()
48
+ print("Generate a number in [0,1).")
49
+ fastrand.pcg32_uniform()
30
50
 
31
51
  if fastrand.SIXTYFOUR: # support for xorshift128+ is limited to some 64-bit platforms (linux, macos, etc.)
32
52
  print("generate an integer in [0,1001)")
@@ -35,8 +55,12 @@ if fastrand.SIXTYFOUR: # support for xorshift128+ is limited to some 64-bit plat
35
55
  fastrand.xorshift128plusrandint(100,1000) # requires Python 3.7 or better
36
56
  print("Generate a random 64-bit integer.")
37
57
  fastrand.xorshift128plus()
58
+ print("Generate a number in [0,1).")
59
+ fastrand.xorshift128plus_uniform()
38
60
  ```
39
61
 
62
+ We also include functions for fast float generation.
63
+
40
64
  It is nearly an order of magnitude faster than the alternatives:
41
65
 
42
66
  ```
@@ -50,6 +74,7 @@ python3 -m timeit -s 'import fastrand' 'fastrand.pcg32randint(100,1000)'
50
74
  python3 -m timeit -s 'import random' 'random.randint(0,1000)'
51
75
  1000000 loops, best of 5: 216 nsec per loop
52
76
 
77
+ # if you have numpy:
53
78
  python3 -m timeit -s 'import numpy' 'numpy.random.randint(0, 1000)'
54
79
  500000 loops, best of 5: 955 nsec per loop
55
80
 
@@ -59,36 +84,53 @@ The pcg32 generator is a 32-bit generator so it generates values in the interval
59
84
  The xorshift128+ generator is a 64-bit generator so that it can generate values in a 64-bit range (up to `2**64-1`).
60
85
 
61
86
 
87
+ ## Installation
88
+
62
89
  If you have Linux, macOS or Windows, you should be able to do just pip install...
63
90
 
64
- ```
91
+ ```bash
65
92
  pip install fastrand
66
93
  ```
67
94
 
68
95
  You may need root access (sudo on macOS and Linux).
69
96
 
70
- It is sometimes useful to install a specific version, you can do so as follows;
97
+ It is sometimes useful to install a specific version, you can do so as follows:
71
98
 
72
- ```
99
+ ```bash
73
100
  pip install fastrand==1.2.4
74
101
  ```
75
102
 
103
+ ### Using uv (recommended)
104
+
105
+ [uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver.
106
+
107
+ To add fastrand as a dependency to your project:
108
+
109
+ ```bash
110
+ uv add fastrand
111
+ ```
112
+
113
+ Or to install it directly into your current environment:
76
114
 
115
+ ```bash
116
+ uv pip install fastrand
117
+ ```
77
118
 
78
- Generally, you can build the library as follows (if you have root):
119
+ ### Building from source
79
120
 
121
+ With uv:
80
122
 
81
123
  ```bash
82
- python setup.py build
83
- python setup.py install
124
+ uv build
125
+ uv pip install dist/*.whl
84
126
  ```
85
127
 
86
- or
128
+ Or with standard tools:
87
129
 
88
130
  ```bash
89
- python setup.py build
90
- python setup.py install --home=$HOME
91
- export PYTHONPATH=$PYTHONPATH:~/lib/python
131
+ pip install build
132
+ python -m build
133
+ pip install dist/*.whl
92
134
  ```
93
135
 
94
136
 
@@ -0,0 +1,6 @@
1
+ fastrand.cpython-38-darwin.so,sha256=LC2Q7ttalxjYSQyL_IKqkiXdxJ4EjCQtAvskIi79INI,15152
2
+ fastrand-3.0.7.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
3
+ fastrand-3.0.7.dist-info/METADATA,sha256=VPHHRYtv-5jM_L9-vOdT5GYDohnY0imPIaV-yCElvkg,4917
4
+ fastrand-3.0.7.dist-info/WHEEL,sha256=Kx6RWhSVfL88-gHgRuuK5c46fDrxzStSDcWbfEAkrVo,108
5
+ fastrand-3.0.7.dist-info/top_level.txt,sha256=hP1UU0jrDjL5G11OfRmlRKfqliLNNwcD51wtEzKsIlU,20
6
+ fastrand-3.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: setuptools (75.3.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-macosx_10_9_x86_64
5
5
 
@@ -0,0 +1,2 @@
1
+ fastrand
2
+ wheelhouse
Binary file
@@ -1,6 +0,0 @@
1
- fastrand.cpython-38-darwin.so,sha256=hapTFVg1UEPk9jCKBujdk23yfxOuE-jHHxM1R_Z1LEI,14824
2
- fastrand-3.0.5.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
3
- fastrand-3.0.5.dist-info/METADATA,sha256=owEgXbHVEfvtUClfdx2yyh7YvC0tm5BSb8gTr_2SYII,3597
4
- fastrand-3.0.5.dist-info/WHEEL,sha256=pXLpj1wTvqlD6RVUEKOuGQGeFX0NOPyDrsC-9xVDmYU,109
5
- fastrand-3.0.5.dist-info/top_level.txt,sha256=Z3tGZhQlNI6bOnJeYeHyE5sSKqud1hxYNfa7SX5Bm4U,9
6
- fastrand-3.0.5.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- fastrand