{"id":22881306,"url":"https://github.com/gvozdevleonid/python_bladerf","last_synced_at":"2025-05-08T00:52:46.075Z","repository":{"id":244456505,"uuid":"815294549","full_name":"GvozdevLeonid/python_bladerf","owner":"GvozdevLeonid","description":"This is a Cyhton wrapper for bladerf. It includes additional pybladerf-tools. It probably can work on Android using buildozer installer.","archived":false,"fork":false,"pushed_at":"2025-05-03T22:15:23.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:52:39.986Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GvozdevLeonid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-14T19:39:18.000Z","updated_at":"2025-05-03T22:15:27.000Z","dependencies_parsed_at":"2024-06-14T20:57:45.348Z","dependency_job_id":"acc0889d-ca8b-4079-a4da-28af27f89958","html_url":"https://github.com/GvozdevLeonid/python_bladerf","commit_stats":null,"previous_names":["gvozdevleonid/python_bladerf"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GvozdevLeonid%2Fpython_bladerf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GvozdevLeonid%2Fpython_bladerf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GvozdevLeonid%2Fpython_bladerf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GvozdevLeonid%2Fpython_bladerf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GvozdevLeonid","download_url":"https://codeload.github.com/GvozdevLeonid/python_bladerf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978724,"owners_count":21834914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T17:32:45.064Z","updated_at":"2025-05-08T00:52:46.066Z","avatar_url":"https://github.com/GvozdevLeonid.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python_bladerf\n\npython_bladerf is a cython wrapper for [bladerf](https://github.com/Nuand/bladeRF). It also contains some additional tools.\n\nBefore installing python_bladerf library, you must have bladerf host software installed. Because this library uses dynamic linking with an existing library file.\n\nYou can install this library using\n```\npip install git+https://github.com/GvozdevLeonid/python_bladerf.git\n```\n\nIf your bladerf files are in non-standard paths and during installation the python_bladerf cannot find libbladeRF.h and bladeRF2.h or the library files, you can specify the paths via environment variables\n```\nexport PYTHON_BLADERF_CFLAGS=path_to_libbladeRF.h_andbladeRF2.h\nexport PYTHON_BLADERF_LDFLAGS=path_to_libbladerf.(so, dylib, dll)\n```\n\n## Requirements:\n* libusb-1.0 (https://github.com/libusb/libusb)\n* libBladeRF (https://github.com/Nuand/bladeRF)\n* Cython==0.29.37\n* Numpy\u003e=2.2.1\n* Scipy (optional, for faster work)\n* pyFFTW (optional, for faster work)\n* pyjnius and android (only for android)\n\n## bladerf:\nThe library supports all bladerf2 functions, some of the functions can also work on the first versions.If there is a demand for full support of the first version, I will add it.\n\n## pybladerf tools:\n* pybladerf_info.py - Reading information about found devices.\n* pybladerf_sweep.pyx - a function that allows you to obtain a sweep over a given frequency range ( same as hackrf_sweep)\n* pybladerf_transfer.pyx - a function that allows you to record and play back samples\n\n## usage\n```\nusage: python_bladerf [-h] {info, sweep, transfer} ...\n\npython_bladerf is a Python wrapper for libbladerf. It also contains some additional tools.\n\noptions:\n  -h, --help    show this help message and exit\n\nAvailable commands:\n  {info,sweep,transfer}\n    info        Read device information from Bladerf such as serial number and FPGA version.\n    sweep       a command-line spectrum analyzer.\n    transfer    Send and receive signals using BladeRF. Input/output files consist of complex64 quadrature samples.\n```\n```\nusage: python_bladerf info [-h] [-f] [-s]\n\noptions:\n  -h, --help            show this help message and exit\n  -f, --full            show full info\n  -s, --serial_numbers  show only founded serial_numbers\n```\n```\nusage: python_bladerf sweep [-h] [-d] [-f] [-g] [-w] [-c] [-1] [-N] [-o] [-B] [-S] [-s] [-b] [-r]\n\noptions:\n  -h, --help  show this help message and exit\n  -d          serial number of desired BladeRF\n  -f          freq_min:freq_max. minimum and maximum frequencies in MHz start:stop or start1:stop1,start2:stop2. Default\n  -g          RX gain, -15 - 60dB, 1dB steps\n  -w          FFT bin width (frequency resolution) in Hz\n  -c          RX channel. which channel to use (0, 1). Default is 0\n  -1          one shot mode. If specified = Enable\n  -N          Number of sweeps to perform\n  -o          oversample. If specified = Enable\n  -B          binary output. If specified = Enable\n  -S          sweep style (\"L\" - LINEAR, \"I\" - INTERLEAVED). Default is INTERLEAVED\n  -s          sample rate in MHz  (0.5 MHz - 122 MHz). Default is 61. To use a sample rate higher than 61, specify oversample\n  -b          baseband filter bandwidth in MHz (0.2 MHz - 56 MHz). Default .75 * sample rate\n  -r          filename. output file\n```\n```\npython_bladerf transfer [-h] [-d] [-r] [-t] [-f] [-p] [-c] [-g] [-N] [-R] [-s] -[b] [-H] -[o]\n\noptions:\n  -d                  serial number of desired BladeRF\n  -r                  \u003cfilename\u003e receive data into file (use \"-\" for stdout)\n  -t                  \u003cfilename\u003e transmit data from file (use \"-\" for stdout)\n  -f, --freq_hz       frequency in Hz (0MHz to 6000MHz supported). Default is 900MHz\n  -p                  antenna port power. If specified = Enable\n  -c                  RX or TX channel. which channel to use (0, 1). Default is 0\n  -g                  RX or TX gain, RX: -15 - 60dB, 1dB steps, TX: -24 - 66 dB, 1dB steps\n  -N                  number of samples to transfer (default is unlimited)\n  -R                  repeat TX mode. Fefault is off\n  -s                  sample rate in MHz  (0.5 MHz - 122 MHz). Default is 61. To use a sample rate higher than 61, specify oversample'\n  -b                  baseband filter bandwidth in MHz (0.2 MHz - 56 MHz). Default .75 * sample rate\n  -H                  synchronize RX/TX to external trigger input\n  -o                  oversample. If specified = Enable\n```\n\n## Android\nThis library can work on android. To do this, go to the android directory and download 3 recipes for [p4a](https://github.com/kivy/python-for-android).\n\nbuildozer.spec\n```\nrequirements = python3,android,pyjnius,numpy,libusb,libbladerf,python_bladerf\np4a.local_recipes = path_to_pythonforandroidrecipes_folder\n```\n\n#### Your recipes folder should contain at least the following files:\n```\npythonforandroidrecipes/\n    __init__.py\n    libusb/\n        __init__.py\n    python_bladerf/\n        __init__.py\n    libbladerf/\n        __init__.py\n        bladerf_android.patch\n        pre_install.cmake\n        jni/\n            Android.mk\n            Application.mk\n            libbladerf.mk\n            libad936x.mk\n        src/\n            libusb.c\n            log.c\n```\n\n## Examples\nPlease use the original bladerf documentation","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvozdevleonid%2Fpython_bladerf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgvozdevleonid%2Fpython_bladerf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvozdevleonid%2Fpython_bladerf/lists"}