Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PyO3/pyo3
/ functions
Functions
4,885 in github.com/PyO3/pyo3
⨍
Functions
4,885
◇
Types & classes
1,305
↳
Endpoints
2
↓ 247 callers
Method
as_ptr
Returns the raw pointer to the capsule name.
src/types/capsule.rs:620
↓ 241 callers
Method
map
Consumes the [`PyClassGuard`] and returns a [`PyClassGuardMap`] for a component of the borrowed data # Examples ``` # use pyo3::prelude::*; # use py
src/pyclass/guard.rs:147
↓ 187 callers
Method
py
(&self)
src/impl_/coroutine.rs:32
↓ 176 callers
Method
iter
(&self)
src/types/set.rs:204
↓ 125 callers
Method
cast
(&self)
src/instance.rs:162
↓ 113 callers
Method
to_string
Convert the raw data to a Rust string. For UCS-1 / UTF-8, returns a borrow into the original slice. For UCS-2 and UCS-4, returns an owned string. Re
src/types/string.rs:72
↓ 109 callers
Method
cast_into_unchecked
(self)
src/instance.rs:328
↓ 105 callers
Method
into_py_dict
(self, py: Python<'py>)
src/types/dict.rs:811
↓ 102 callers
Method
into_any
(self)
src/instance.rs:879
↓ 101 callers
Method
len
(&self)
src/types/bytes/writer.rs:70
↓ 87 callers
Method
bind
(&self, _py: Python<'py>)
src/instance.rs:1746
↓ 84 callers
Method
clone
(&self)
src/instance.rs:823
↓ 84 callers
Method
into_pyobject
(self, py: Python<'py>)
src/types/list.rs:1495
↓ 79 callers
Method
assume_owned_or_err
(self, py: Python<'_>)
src/ffi_ptr_ext.rs:44
↓ 73 callers
Method
eval
Evaluates a Python expression in the given context and returns the result. If `globals` is `None`, it defaults to Python module `__main__`. If `local
src/marker.rs:593
↓ 71 callers
Method
push
(&mut self, obj: &Bound<'_, PyAny>)
pytests/src/objstore.rs:20
↓ 69 callers
Method
getattr
(&self, attr_name: N)
src/types/any.rs:858
↓ 62 callers
Method
as_ref
(&self)
src/pycell.rs:279
↓ 53 callers
Method
into_pyobject
(self, py: Python<'py>)
tests/test_getter_setter.rs:331
↓ 49 callers
Method
insert
Inserts an item at the specified index. If `index >= self.len()`, inserts at the end.
src/types/list.rs:392
↓ 48 callers
Function
fetch
()
pyo3-ffi/examples/sequential/tests/test.rs:101
↓ 48 callers
Method
is_empty
(&self)
src/types/bytes/writer.rs:64
↓ 46 callers
Function
error_on_negative
(py: Python<'_>, result: T)
src/err/mod.rs:762
↓ 46 callers
Function
f
()
src/conversions/eyre.rs:141
↓ 46 callers
Method
set_item
(&self, key: K, value: V)
src/types/any.rs:1170
↓ 45 callers
Method
run
Executes one or more Python statements in the given context. If `globals` is `None`, it defaults to Python module `__main__`. If `locals` is `None`,
src/marker.rs:636
↓ 44 callers
Method
clone
(&self)
src/impl_/pyclass.rs:183
↓ 43 callers
Method
to_owned
Creates a new owned [`Bound<T>`] from this borrowed reference by increasing the reference count. # Example ``` use pyo3::{prelude::*, types::PyTuple}
src/instance.rs:985
↓ 41 callers
Method
as_borrowed
(&'a self)
src/instance.rs:886
↓ 41 callers
Method
import
Imports the Python module with the specified name. # Examples ```no_run # fn main() { use pyo3::prelude::*; Python::attach(|py| { let module = PyMo
src/types/module.rs:108
↓ 40 callers
Method
assume_owned
(self, py: Python<'_>)
src/ffi_ptr_ext.rs:63
↓ 40 callers
Method
finalize
(self)
pyo3-build-config/src/impl_.rs:971
↓ 39 callers
Function
Py_IS_TYPE
(ob: *mut PyObject, tp: *mut PyTypeObject)
pyo3-ffi/src/object.rs:257
↓ 39 callers
Method
as_ref
(&self)
src/types/bytes.rs:355
↓ 39 callers
Method
run
( &self, globals: Option<&Bound<'py, PyDict>>, locals: Option<&Bound<'py, PyDict>>,
src/types/code.rs:108
↓ 38 callers
Method
cast_into
(self)
src/instance.rs:211
↓ 38 callers
Function
get
Loads the configuration determined from the build environment. This function must be called from a build script, and requires a direct dependency on
pyo3-build-config/src/lib.rs:138
↓ 38 callers
Method
into_pyobject_or_pyerr
(self, py: Python<'py>)
src/conversion.rs:248
↓ 38 callers
Method
is_null
(&self)
pyo3-ffi/src/methodobject.rs:189
↓ 35 callers
Method
as_any
(&self)
src/instance.rs:870
↓ 35 callers
Method
into_iter
Returns an iterator of values in this set. # Panics If PyO3 detects that the set is mutated during iteration, it will panic.
src/types/set.rs:218
↓ 35 callers
Method
try_into
(self)
src/fmt.rs:172
↓ 35 callers
Method
unbind
(self)
src/instance.rs:894
↓ 34 callers
Method
getattr
Retrieves an attribute value. This is equivalent to the Python expression `self.attr_name`. If calling this method becomes performance-critical, the
src/instance.rs:1902
↓ 32 callers
Method
None
(self)
src/marker.rs:668
↓ 32 callers
Function
Py_TYPE
(ob: *mut PyObject)
pyo3-ffi/src/object.rs:211
↓ 32 callers
Method
as_bytes
Obtain the raw bytes backing this instance as a [u8] slice.
src/types/string.rs:41
↓ 32 callers
Method
as_ptr
(&self)
src/buffer.rs:812
↓ 32 callers
Method
call0
(&self)
src/types/any.rs:1090
↓ 32 callers
Method
get_item
(&self, key: K)
src/types/any.rs:1161
↓ 32 callers
Method
into_bound
Connects this guard to the given Python attachment. PyO3 does not currently support using a module from multiple interpreters, so `py` is the attachm
src/types/context.rs:205
↓ 30 callers
Method
py
Returns a `Python` token that is bound to the lifetime of the `PyRef`.
src/pycell.rs:269
↓ 29 callers
Method
clone
(&self)
tests/test_compile_error.rs:389
↓ 29 callers
Method
into_pyobject
(self, _py: Python<'py>)
src/fmt.rs:162
↓ 29 callers
Method
unbind
Removes the connection to the current Python attachment, allowing the guard to be stored outside it or sent to another thread. Dropping the returned
src/types/context.rs:127
↓ 28 callers
Method
insert
(&mut self, k: S, v: S)
pyo3-build-config/src/impl_.rs:2080
↓ 27 callers
Method
call1
(&self, args: A)
src/types/any.rs:1094
↓ 27 callers
Method
extract
Extracts some type from the Python object. This is a wrapper function around [`FromPyObject::extract()`](crate::FromPyObject::extract).
src/instance.rs:1009
↓ 27 callers
Method
insert
Inserts a value into the list. Returns `Some(val)` if the `PyObjectFreeList` is full.
src/impl_/freelist.rs:73
↓ 27 callers
Method
value
Returns the value of this exception. # Examples ```rust use pyo3::{exceptions::PyTypeError, PyErr, Python}; Python::attach(|py| { let err: PyErr =
src/err/mod.rs:233
↓ 26 callers
Method
as_ptr
(&self)
pyo3-ffi/src/methodobject.rs:184
↓ 26 callers
Method
get
(&self, _py: Python<'_>)
src/sync.rs:91
↓ 25 callers
Method
push
(mut self, slot: c_int, value: *mut c_void)
src/impl_/pymodule.rs:434
↓ 25 callers
Method
push_str
(&mut self, value: &str)
pyo3-macros-backend/src/introspection.rs:558
↓ 25 callers
Method
raw
(&self)
src/buffer.rs:751
↓ 23 callers
Method
add_subclass
(self, subclass_value: S)
src/pyclass_init.rs:126
↓ 23 callers
Method
append
Appends an item to the list.
src/types/list.rs:378
↓ 23 callers
Method
borrow_mut
(&self)
src/instance.rs:587
↓ 23 callers
Method
cast_unchecked
(&self)
src/instance.rs:317
↓ 23 callers
Method
is_none
Returns whether the object is considered to be None. This is equivalent to the Python expression `self is None`.
src/instance.rs:1858
↓ 22 callers
Function
PyDateTimeAPI
()
pyo3-ffi/src/datetime.rs:606
↓ 21 callers
Method
as_mapping
(&self)
src/types/mappingproxy.rs:117
↓ 21 callers
Method
lock
Acquire the mutex, blocking the current thread until it is able to do so.
src/sync/mutex.rs:166
↓ 21 callers
Method
next
Advances the iterator and returns the next value.
src/types/set.rs:250
↓ 20 callers
Function
PyObject_TypeCheck
(ob: *mut PyObject, tp: *mut PyTypeObject)
pyo3-ffi/src/object.rs:416
↓ 20 callers
Method
borrow
(obj: &Bound<'py, T>)
src/pycell.rs:310
↓ 20 callers
Method
detach
Temporarily releases the GIL, thus allowing other Python threads to run. The GIL will be reacquired when `F`'s scope ends. If you don't need to touch
src/marker.rs:562
↓ 20 callers
Method
is_none
(&self)
src/types/any.rs:1153
↓ 19 callers
Method
into_pyobject
(self, py: Python<'py>)
src/conversions/jiff.rs:107
↓ 19 callers
Method
take
Takes the current error from the Python interpreter's global state and clears the global state. If no error is set, returns `None`. If the error is a
src/err/mod.rs:287
↓ 18 callers
Function
_run_cargo
( session: nox.Session, *args: str, expect_error: bool = False, **kwargs: Any )
noxfile.py:1979
↓ 18 callers
Method
get
(&self, bit_offset: usize, bit_width: u8)
pyo3-ffi/src/cpython/unicodeobject.rs:76
↓ 18 callers
Method
install
(py: Python<'_>)
tests/test_utils/mod.rs:203
↓ 18 callers
Method
lib_name
The name of the link library defining Python. This effectively controls the `cargo:rustc-link-lib=<name>` value to control how libpython is linked. V
pyo3-build-config/src/impl_.rs:321
↓ 18 callers
Method
parse
Transforms a rust fn arg parsed with syn into a method::FnArg
pyo3-macros-backend/src/method.rs:153
↓ 17 callers
Function
_run
Wrapper for _run(session, which creates nice groups on GitHub Actions.
noxfile.py:1957
↓ 17 callers
Method
call
Calls the object. This is equivalent to the Python expression `self(*args, **kwargs)`.
src/instance.rs:1942
↓ 17 callers
Method
extract
(ob: Borrowed<'_, 'py, PyAny>)
src/conversions/jiff.rs:131
↓ 17 callers
Function
new_py_datetime_ob
(py: Python<'py>, name: &str, args: A)
src/conversions/chrono.rs:1224
↓ 17 callers
Method
restore
(self, py: Python<'_>)
src/err/mod.rs:451
↓ 17 callers
Function
sleep
(seconds: f64)
tests/test_coroutine.rs:115
↓ 17 callers
Method
span
(&self)
pyo3-macros-backend/src/derive_attributes.rs:106
↓ 17 callers
Method
stable_abi
(self, kind: StableAbi)
pyo3-build-config/src/impl_.rs:932
↓ 16 callers
Function
Py_None
()
pyo3-ffi/src/object.rs:662
↓ 16 callers
Function
_get_attr
(obj: *mut PyObject, field: &core::ffi::CStr)
pyo3-ffi/src/datetime.rs:353
↓ 16 callers
Method
add
Adds an element to the set.
src/types/frozenset.rs:36
↓ 16 callers
Method
as_type_ptr
(&self)
src/types/typeobject.rs:116
↓ 16 callers
Method
call_method0
(&self, name: N)
src/types/any.rs:1121
↓ 16 callers
Method
into_pyobject
(self, py: Python<'py>)
src/conversions/std/num.rs:197
↓ 15 callers
Method
as_mut_ptr
(&mut self)
src/types/bytes/writer.rs:81
next →
1–100 of 4,885, ranked by callers