Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.374.325 Times

URLObject 0.2

Company: Zachary Voase
Date Added: July 30, 2013  |  Visits: 397

URLObject

Report Broken Link
Printer Friendly Version


Product Homepage
Download (39 downloads)



URLObject is an utility class for manipulating URLs.<br /><br />Example Usage:<br /><br />Here is how you use the library:<br /><br />>>> from urlobject import URLObject<br />>>> url = URLObject(host='example.com')<br />>>> print url<br />http://example.com/<br />>>> print url / 'some' / 'path'<br />http://example.com/some/path<br />>>> print url & ('key', 'value')<br />http://example.com/?key=value<br />>>> print url & ('key', 'value') & ('key2', 'value2')<br />http://example.com/?key=value&key2=value2<br />>>> print url * 'fragment'<br />http://example.com/#fragment<br />>>> print url / u'N{LATIN SMALL LETTER N WITH TILDE}'<br />http://example.com/?*A*<br />>>> url<br /><br />>>> new_url = url / 'place'<br />>>> new_url<br /><br />>>> new_url &= 'key', 'value'<br />>>> new_url<br /><br />>>> new_url &= 'key2', 'value2'<br />>>> new_url<br /><br />>>> new_url |= 'key', 'newvalue'<br />>>> new_url<br /><br /><br />Important points to note<br /><br /> * URLObjects are completely unicode-aware (they subclass unicode). This also means that international hostnames will be encoded to IDNA format, and international characters in pathnames will be automatically escaped. You should continue using unicode values for everything; the various components will be en/decoded on-the-fly.<br /> * url & (key, value) adds key=value to URL, even if key is already present as a query parameter. This allows you to have multiple appearances of key in the query.<br /> * url | (key, value) adds key=value to URL, removing any previous appearance of key in the query parameters.<br /> * url & dictionary and url | dictionary work similarly to their (key, value) counterparts, only they add every key, value pair in the dictionary to the query string. You can also pass in a list of key, value pairs.<br /> * url / 'path' adds 'path' to the current path, quoting special characters if necessary.<br /> * url // 'path' sets the path to 'path', removing the current path if present.<br /> * url * 'fragment' sets the fragment to 'fragment'.<br /> * url ^ 123 sets the port number to 123.<br /> * url.with_*(value) can be done with scheme, host, port, path, query and fragment, returning a new URL object with the value in that place.<br /> * url.without_port(), url.without_path(), url.without_query() and url.without_fragment() all exist and do something obvious.<br /> * Operations return a new URL object (URL objects are immutable).<br /><br />Hints and tips<br /><br /> * If a URL's scheme is 'http' and you try to set the port to 80, it is equivalent to not specifying the port (same goes for 'https', 'ftp' and 'ftps' for their appropriate ports).<br /> * If you need to end the path with '/', you can do either url / '' or url / 'last_component/'.<br /> * The query parameters are available as a list through the query_list() method and as a dictionary via query_dict(). By default, the latter method will return a dictionary with lists as the values, corresponding to potential multiple occurrences of the same key. You can just take the last value by passing the seq=False keyword argument to the method.<br /> * Since URLObject subclasses directly from Python's built-in unicode, you can pass URL objects straight into urllib2.urlopen(), JSON serializers, templating systems, etc. If you need a plain-old string or Unicode object, you can just call str or unicode on it.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Characters Current Dictionary Gtgtgtgt International Method Object Parameters Present Print Query Unicode Url Urllt Values
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


URLOBJECT RELATED
Database Tools  -  PHP AJAX pagination 1.0
PHP AJAX pagination takes as parameters an SQL query, the number of results to show per page and the current page number.HTML and javascript code is generated in order to display links for browsing the query result pages.When the user clicks on...
61.44 KB  
Libraries  -  Params::Validate 0.88
Params::Validate is a Perl module to validate method/function parameters. SYNOPSIS use Params::Validate qw(:all); # takes named params (hash or hashref) sub foo { validate( @_, { foo => 1, # mandatory bar => 0, # optional } ); } #...
79.87 KB  
Utilities  -  kapullo's scripts 1.0b5
kapullo's scripts is a collection of AppleScripts, most of them thought for applescripters. Actually, there are 6 categories: ???*Nz AppleScripter -> eval: you enter applescript code and it checks its syntax and, optionally,...
409.6 KB  
Database Tools  -  vladzur Database 0.8
A connection to a MySQL database can be established and SQL INSERT, UPDATE, DELETE and DESCRIBE queries can be executed from parameters that specify the tables, fields and values to...
10 KB  
Programming  -  datascooter 1.0
It is a small, fast , fresh object/relational persistence and query system, with commented and fully-functional JUnit tests. 20 times smaller. Based on eclipse plugins, mapping based on the eclipse extension points, but it can run without eclipse...
11.59 MB  
Text Management  -  Conversion to unicode or byte string 1.0
Python's built in function str() and unicode() return a string representation of the object in byte string and unicode string respectively. This script introduces an enhanced version of str() and unicode() that could be used as handy functions...
 
Database Tools  -  My One Line SQL 1.0
Several types of common queries can be run with a single call by using eventual parameters to define queries that take variable values.Key Features of My One Line SQL:- SELECT what FROM tablename- SELECT what FROM tablename WHERE where_expression-...
10 KB  
Programming  -  BeanKeeper 2.6.3
Powerful object/relational persistence and query library for Java BeanKeeper, formerly called 'Simple Persistence for Java' is a free, open source, full featured, powerful object/relational persistence and query library for Java.
368.64 KB  
Miscellaneous  -  Fast copy of an object having a slow __init__ 1.0
Special method __copy__ is the easiest way for an object to cooperate with the copy.copy function. This script allows you to bypass the object's __init__, even if it's slow, to get an 'empty' object of this class.
 
Libraries  -  Object::Realize::Later 0.16
Object::Realize::Later is a Perl module with delayed creation of objects. SYNOPSIS package MyLazyObject; use Object::Realize::Later becomes => MyRealObject, realize => load; The Object::Realize::Later class helps with implementing...
10.24 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB