aboutsummaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)AuthorFilesLines
2023-07-19Small Python modernization of Brotli code.Thomas Fischbacher1-34/+68
PiperOrigin-RevId: 549289787
2023-07-05add tests with UTF8/UTF16 non-ASCII textEvgenii Kliuchnikov1-0/+2
PiperOrigin-RevId: 545424981
2023-02-01Fix permissionsEvgenii Kliuchnikov1-1/+1
PiperOrigin-RevId: 506096478
2023-01-17Internal changeBrotli5-5/+12
PiperOrigin-RevId: 502401179
2022-12-29Python: use a new output buffer code (#902)Ma Lin1-142/+372
Currently, the output buffer is a std::vector<uint8_t>. When the buffer grows, resizing will cause unnecessary memcpy(). This change uses a list of bytes object to represent output buffer, can avoid the extra overhead of resizing. In addition, C++ code can be removed, it's a pure C extension.
2022-11-17UpdateEvgenii Kliuchnikov1-3/+5
Documentation: - add note that brotli is a "stream" format, not an archive-like - regenerate .1 with Pandoc Build: - drop legacy "BROTLI_BUILD_PORTABLE" option - drop "BROTLI_SANITIZED" definition Code: - c: comb includes - c/enc: extract encoder state into separate header - c/enc: drop designated q10 codepath - c/enc: dealing better with flushing of empty stream - fix MSVC compilation API: - py: use library version instead of one in version.h - c: add plugable API to report consumed input / produced output - c/java: support "lean" prepared dictionaries (without copy of source)
2021-11-10Prepare for copybara (#939)Eugene Kliuchnikov1-6/+10
Co-authored-by: Eugene Kliuchnikov <eustas@chromium.org>
2021-08-18Update (#918)Eugene Kliuchnikov1-1/+0
Prepare to use copybara worklow.
2020-05-15Update (#807)Eugene Kliuchnikov1-0/+0
- fix formatting - fix type conversion - fix no-op arithmetic with null-pointer - improve performance of hash_longest_match64 - go: detect read after close - java decoder: support compound dictionary - remove executable flag on non-scripts
2019-07-17Update (#762)Eugene Kliuchnikov1-7/+8
* put LICENSE file into .jar * fix typo * add clarification comment in PY wrapper
2018-11-12Ensure decompression consumes all input (#730)Justin Ridgewell3-2/+15
* Ensure decompression consumes all input If not, it's a corrupt stream. * Use byte strings
2018-03-23Fix "memory leak" in python tests (#652)Eugene Kliuchnikov2-0/+6
OOMs on RPi (1GB)
2017-08-28Update (#590)Eugene Kliuchnikov2-17/+39
* add transpiled JS decoder * make PY wrapper accept memview * fix dictionary generator * speedup compression of RLEish data
2017-08-23disable buidling/deployment of python wheels (#583)Cosimo Lupo2-13/+17
* [appveyor] remove 'deploy' stage; only test python 2.7 and 3.6 all the other python versions are being built and tested on https://github.com/google/brotli-wheels/blob/d571d63/appveyor.yml * remove terrify submodule as not needed any more * [travis] just test py2.7 and 3.6 on linux; remove extra osx python builds All the other python versions for OSX are being built/tested on: https://github.com/google/brotli-wheels/blob/d571d63/.travis.yml Also, there's no need to build and deploy wheels here, as that's done in the separate repository. * [setup.py] only rebuild if dependency are newer; fix typo in list of 'depends' https://github.com/python/cpython/blob/v3.6.2/Lib/distutils/command/build_ext.py#L485-L500 * [ci] only run 'python setup.py test' if we run 'python setup.py built test', the setuptools 'test' command will forcibly re-run the build_ext subcommand because it wants to pass the --inplace option (it ignores whether it's up to date, just re-runs it all the time). with this we go from running built_ext twice, to running it only once per build * [Makefile] run 'build_ext --inplace' instead of 'develop' as default target The 'develop' command is like 'install' in the sense that it modifies the user's python environment. The default make target should be less intrusive, i.e. just building the extension module in-place without modify anything in the user's environment. We don't need to tell make about the dependency between 'test' and 'build' target as that is baked in the `python setup.py test` command. * [Makefile] add 'develop' target; remove unnecessary 'tests' target `make test` is good enough * [Makefile] `setup.py test` requires setuptools; run `python -m unittest` This will work even if setuptools is not installed, which is unlikely nowadays but still our `setup.py` works with plain distutils, so we may well have our tests work without setuptools. * [python/README.md] add ref to 'develop' target; remove 'tests', just 'make test' * [setup.py] import modules as per nicksay's comment https://github.com/google/brotli/pull/583#discussion_r131981049 * [Makefile] add 'develop' to .PHONY targets remove 'tests' from .PHONY * [appveyor] remove unused setup scripts We don't need to install custom python versions, we are using the pre-installed ones on Appveyor. * [appveyor] remove unneeded setup code
2017-08-08Python: Update bro_test to reference script directly (#582)Alex Nicksay3-11/+9
2017-08-04Update API, and more (#581)Eugene Kliuchnikov5-101/+18
Update API, and more: * remove "custom dictionary" support * c/encoder: fix #580: big-endian build * Java: reduce jar size * Java: speedup decoding * Java: add 32-bit CPU support * Java: make source code JS transpiler-ready
2017-08-02Python: Add a "make install" command and clarify installation docs (#578)Alex Nicksay2-5/+18
Closes #576
2017-07-21Update (#574)custom-dictionaryEugene Kliuchnikov1-2/+4
* Update * decoder: better behavior after failure * encoder: replace "len_x_code" with delta * research: add experimental dictionary generator * python: test combing
2017-06-30Update (#569)Eugene Kliuchnikov2-3/+50
* add misssing fclose in `brotli.c` * add basic tests for python `Decompressor` type * minor lint fixes in `_brotli.cc`
2017-06-28Python: Decompressor: Streaming decompression support (#546)Janek2-0/+244
python-brotli has Compressor for streaming compression but nothing for streaming decompression. This is a straight-forward copy of the Compressor code into the new class Decompressor.
2016-12-21Python: Create Makefile for development shortcuts (#488)Alex Nicksay2-14/+68
2016-12-20Move brotlidump.py to research/ (#487)Eugene Kliuchnikov1-2361/+0
2016-12-20brotlidump.py: disassemble brotli file (revisited) (#314)jneb1-0/+2361
* Create brotlidump.py Sorry, I am a newbie. I couldn't find my file anymore when I wanted to edit it. Hope I don't waste your time. * Fixed a bug where it couldn't read its own compression. The problem was that a prefix code ending with a 16 "repeat" didn't realize the table was full already. Also minor bug fixes, comments and stuff. * Major refactoring Rewrote almost everything. Now can dump its own compression. * Now more or less complete Appears to handle all files completely (including metablock data). Used as inspiration for the the hex example (see makehexexample.py)
2016-12-20Python: Simplify test suite generation by using unittest discovery (#485)Alex Nicksay5-4/+4
2016-12-12Python: Use a temporary directory for generated files in tests (#481)Alex Nicksay1-2/+5
2016-12-12Python: Format bro.py with yapf (#480)Alex Nicksay1-44/+88
2016-12-12Update python brotli wrapper (#479)Eugene Kliuchnikov1-11/+20
* Update python brotli wrapper * release GIL on CPU intensive blocks, fixes #476 * use BrotliDecoderTakeOutput (less memory, less memcpy) * Python: Convert bro.py tests to unittest style (#478) * Create unittest-style tests for `bro.py` decompression and compression * Delete old tests for `bro.py` * Update test method generation to properly create a Cartesian product of iterables using `itertools.product` * Update python brotli wrapper * release GIL on CPU intensive blocks, fixes #476 * use BrotliDecoderTakeOutput (less memory, less memcpy)
2016-12-09Python: Convert bro.py tests to unittest style (#478)Alex Nicksay6-213/+159
* Create unittest-style tests for `bro.py` decompression and compression * Delete old tests for `bro.py` * Update test method generation to properly create a Cartesian product of iterables using `itertools.product`
2016-11-09Python: Add unit tests for brotli.compress and brotli.decompress (#467)Alex Nicksay8-119/+282
Also - rename `test_utils` to `_test_utils` - refactor shared code into `_test_utils`
2016-10-31Python: Add tests for streamed compression (#458)Alex Nicksay2-15/+159
Progress on #191
2016-10-31Python: Use "build" instead of "build_ext" in scripts (#460)Alex Nicksay1-1/+1
Previously, the Python package consisted of a single extension module, so `build_ext` was sufficient. Now, the package contains a native module and an extension module, so both `build_py` and `build_ext` are required. Instead, run `build`, which calls both `build_py` and `build_ext` automatically.
2016-10-25Python: Publicly expose the Compressor object in the Python API (#456)Alex Nicksay1-2/+5
Progress on #191
2016-10-24Python: Support streamed compression with the Compressor object (#448)Alex Nicksay2-33/+135
This adds `flush` and `finish` methods to the `Compressor` object in the extension module, renames the `compress` method to `process`, and updates that method to only process data. Now, one or more `process` calls followed by a `finish` call will be equivalent to a module-level `compress` call. Note: To maximize the compression efficiency (and match underlying Brotli behavior, the `Compressor` object `process` method does not guarantee all input is immediately written to output. To ensure immediate output, call `flush` to manually flush the compression buffer. Extraneous flushing can increase the size, but may be required when processing streaming data. Progress on #191
2016-10-18Merge pull request #446 from nicksay/py-3-compressor-objectEugene Kliuchnikov2-52/+193
Python: Create an extension Compressor object
2016-10-17Python: Update README with information about code formattingAlex Nicksay1-3/+36
Also, add a `yapf` section to `setup.cfg` to ensure YAPF runs format code with the Google style.
2016-10-17Python: Create an extension Compressor objectAlex Nicksay2-52/+193
- Create a `Compressor` object in the extension module - Move the `compress` method into the native module and use the new `Compressor` object to do the compression Note: This does not change the module-level Python API. The `Compressor` object will not be publicly exposed until its methods have stabilized.
2016-10-17Python: Create native brotli module and move extension to _brotliAlex Nicksay2-8/+32
2016-09-21Update brotlimodule.ccEugene Kliuchnikov1-1/+1
2016-09-21Update brotlimodule.ccEugene Kliuchnikov1-3/+2
2016-09-21Update python moduleEugene Kliuchnikov1-9/+8
* use new decoder API
2016-08-23Move "public" to "include/brotli"Eugene Kliuchnikov1-2/+2
2016-08-22Use version from common/version.hEugene Kliuchnikov1-2/+6
2016-08-22Fix brotlimoduleEugene Kliuchnikov1-2/+2
2016-06-23Fix issue #383eustas1-1/+1
2016-06-17Restore platform suffixeustas1-1/+2
2016-06-16Remove platform suffixeustas1-2/+1
2016-06-16Fix library patheustas1-1/+1
2016-06-13Fix CI build.Eugene Kliuchnikov2-35/+37
2016-06-13Convert encoder to plain C.Eugene Kliuchnikov1-1/+1
2016-06-03Fix test file patheustas1-1/+1